From abe923d2ef6475d22ee11da4830f6f1626a0cad7 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 9 Jun 2011 20:49:36 -0300 Subject: [PATCH] atrf-xmit: use receive interrupt instead of polling - atrf-xmit.c (xfer_one): use wait_for_interrupt instead of polling - atrf-xmit.c (xfer_one): fail if there's an unexpected receiver interrupt --- tools/atrf-xmit/atrf-xmit.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/atrf-xmit/atrf-xmit.c b/tools/atrf-xmit/atrf-xmit.c index 2ae6d9d..af57e42 100644 --- a/tools/atrf-xmit/atrf-xmit.c +++ b/tools/atrf-xmit/atrf-xmit.c @@ -72,10 +72,15 @@ static int xfer_one(struct atrf_dsc *tx, struct atrf_dsc *rx) uint8_t buf[PSDU_SIZE+1]; /* +1 for LQI */ int n, i; + if (atrf_interrupt(rx)) { + fprintf(stderr, "unexpected receiver interrupt\n"); + exit(1); + } + atrf_slp_tr(tx, 1, 1); -#if 0 +#if 1 irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START, - 1000, 5); /* 5 ms */ + 1000, 0); #else /* * Just waiting for the maximum time is much faster than polling the