From 0c7146cad964108a696cc32d742a80ed1f62d0d0 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sun, 9 Jan 2011 19:32:05 -0300 Subject: [PATCH] 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 --- tools/atrf-txrx/atrf-txrx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/atrf-txrx/atrf-txrx.c b/tools/atrf-txrx/atrf-txrx.c index b508872..fac166e 100644 --- a/tools/atrf-txrx/atrf-txrx.c +++ b/tools/atrf-txrx/atrf-txrx.c @@ -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; }