IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
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 | ||
---|---|---|
72 | 72 | uint8_t buf[PSDU_SIZE+1]; /* +1 for LQI */ |
73 | 73 | int n, i; |
74 | 74 | |
75 | if (atrf_interrupt(tx)) { | |
75 | if (atrf_interrupt_wait(tx, 1)) { | |
76 | 76 | fprintf(stderr, "unexpected sender interrupt\n"); |
77 | 77 | exit(1); |
78 | 78 | } |
79 | if (atrf_interrupt(rx)) { | |
79 | if (atrf_interrupt_wait(rx, 1)) { | |
80 | 80 | fprintf(stderr, "unexpected receiver interrupt\n"); |
81 | 81 | exit(1); |
82 | 82 | } |
83 | 83 | |
84 | 84 | atrf_slp_tr(tx, 1, 1); |
85 | #if 1 | |
86 | 85 | irq = wait_for_interrupt(rx, IRQ_TRX_END, IRQ_TRX_END | IRQ_RX_START, |
87 | 86 | 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 | |
96 | 87 | if (!(irq & IRQ_TRX_END)) |
97 | 88 | return 0; |
98 | 89 | |
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); | |
104 | 91 | if (!(irq & IRQ_TRX_END)) { |
105 | 92 | fprintf(stderr, "sender claims packet was not sent ?\n"); |
106 | 93 | exit(1); |