Date:2011-06-21 01:41:30 (12 years 9 months ago)
Author:Werner Almesberger
Commit:b7276d282ac52c327a4d0d3d7498ebaac1d18001
Message:atrf-xmit/atrf-xmit.c: updated to no longer use atrf_interrupt

- atrf-xmit.c (xfer_one): use atrf_interrupt_wait instead of
atrf_interrupt to pull the interrupt line
- atrf-xmit.c (xfer_one): removed delay-based wait to interrupt
- atrf-xmit.c (xfer_one): use atrf_interrupt_wait instead of reading
REG_IRQ_STATUS directly
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(tx)) {
75    if (atrf_interrupt_wait(tx, 1)) {
7676        fprintf(stderr, "unexpected sender interrupt\n");
7777        exit(1);
7878    }
79    if (atrf_interrupt(rx)) {
79    if (atrf_interrupt_wait(rx, 1)) {
8080        fprintf(stderr, "unexpected receiver interrupt\n");
8181        exit(1);
8282    }
8383
8484    atrf_slp_tr(tx, 1, 1);
85#if 1
8685    irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START,
8786        0);
88#else
89    /*
90     * Just waiting for the maximum time is much faster than polling the
91     * interrupt, at least for now.
92     */
93    usleep(5000);
94    irq = atrf_reg_read(rx, REG_IRQ_STATUS);
95#endif
9687    if (!(irq & IRQ_TRX_END))
9788        return 0;
9889
99    if (!atrf_interrupt(tx)) {
100        fprintf(stderr, "missing sender interrupt\n");
101        exit(1);
102    }
103    irq = atrf_reg_read(tx, REG_IRQ_STATUS);
90    irq = atrf_interrupt_wait(tx, 1);
10491    if (!(irq & IRQ_TRX_END)) {
10592        fprintf(stderr, "sender claims packet was not sent ?\n");
10693        exit(1);

Archive Download the corresponding diff file



interactive