1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-23 04:21:09 +02:00

tools/: updated tools to use flush_interrupts

- atrf-txrx/atrf-txrx.c (init_txrx), atrf-xmit/atrf-xmit.c
  (init_common): instead of reading REG_IRQ_STATUS, use
  flush_interrupts to flush interrupts
This commit is contained in:
Werner Almesberger 2011-06-20 17:27:19 -03:00
parent 620709a20a
commit b0dd5ced20
2 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ static struct atrf_dsc *init_txrx(const char *driver, int trim, unsigned mhz)
/* We want to see all interrupts, not only the ones we're expecting. */
atrf_reg_write(dsc, REG_IRQ_MASK, 0xff);
(void) atrf_reg_read(dsc, REG_IRQ_STATUS);
flush_interrupts(dsc);
if (atrf_identify(dsc) == artf_at86rf231)
wait_for_interrupt(dsc, IRQ_CCA_ED_DONE, IRQ_CCA_ED_DONE,
10, 50); /* according to table 7-1, 37 us max */

View File

@ -39,7 +39,7 @@ static void init_common(struct atrf_dsc *dsc, int trim, int channel)
atrf_set_clkm(dsc, 0);
atrf_reg_write(dsc, REG_PHY_CC_CCA, (1 << CCA_MODE_SHIFT) | channel);
atrf_reg_write(dsc, REG_IRQ_MASK, 0xff);
(void) atrf_reg_read(dsc, REG_IRQ_STATUS);
flush_interrupts(dsc);
}