1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-22 13:21:53 +02:00

atrf-txrx: updated for AT86RF231 interrupt handling

- atrf-txrx.c (init_txrx): unmask all interrupts for 231 compatibilit,
  where masked interrupts are now indicated in IRQ_STATUS
- atrf-txrx.c (init_txrx): on the 231, wait for (and clear) the CCA_ED_DONE
  interrupt when entering TRX_OFF after reset
This commit is contained in:
Werner Almesberger 2011-01-09 19:32:05 -03:00
parent e8d7150c28
commit 0c7146cad9

View File

@ -78,7 +78,13 @@ static struct atrf_dsc *init_txrx(int trim)
#endif
atrf_reg_write(dsc, REG_TRX_CTRL_0, 0); /* disable CLKM */
/* 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);
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 */
return dsc;
}