Date:2011-06-23 18:18:57 (8 years 2 months ago)
Author:Werner Almesberger
Commit:7c12bf02c1dd6762933c2b5215c2b81e8ccfea73
Message:tools/atrf-xmit/atrf-xmit.c: cleaned up timeouts and interrupt polling

- atrf-xmit.c (xfer_one): wait 10 ms for the packet to be sent (1 ms
was clearly too short)
- atrf-xmit.c (xfer_one): use wait_for_interrupt instead of
atrf_interrupt_wait, so that the retry logic can do its work
Files: tools/atrf-xmit/atrf-xmit.c (1 diff)

Change Details

tools/atrf-xmit/atrf-xmit.c
7272    uint8_t buf[PSDU_SIZE+1]; /* +1 for LQI */
7373    int n, i;
7474
75    if (atrf_interrupt_wait(tx, 1)) {
75    if (wait_for_interrupt(tx, IRQ_TRX_END, IRQ_TRX_END, 1)) {
7676        fprintf(stderr, "unexpected sender interrupt\n");
7777        exit(1);
7878    }
79    if (atrf_interrupt_wait(rx, 1)) {
79    if (wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END, 1)) {
8080        fprintf(stderr, "unexpected receiver interrupt\n");
8181        exit(1);
8282    }
8383
8484    atrf_slp_tr(tx, 1, 1);
8585    irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START,
86        0);
86        10);
8787    if (!(irq & IRQ_TRX_END))
8888        return 0;
8989
90    irq = atrf_interrupt_wait(tx, 1);
90    irq = wait_for_interrupt(tx, IRQ_TRX_END, IRQ_TRX_END, 1);
9191    if (!(irq & IRQ_TRX_END)) {
9292        fprintf(stderr, "sender claims packet was not sent ?\n");
9393        exit(1);

Archive Download the corresponding diff file



interactive