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

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
This commit is contained in:
Werner Almesberger 2011-06-09 20:49:36 -03:00
parent 703ce81dfc
commit abe923d2ef

View File

@ -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 */ uint8_t buf[PSDU_SIZE+1]; /* +1 for LQI */
int n, i; int n, i;
if (atrf_interrupt(rx)) {
fprintf(stderr, "unexpected receiver interrupt\n");
exit(1);
}
atrf_slp_tr(tx, 1, 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, irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START,
1000, 5); /* 5 ms */ 1000, 0);
#else #else
/* /*
* Just waiting for the maximum time is much faster than polling the * Just waiting for the maximum time is much faster than polling the