IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Commit Details
Date: | 2011-06-23 14:41:40 (9 years 6 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | 27fc0a0e2c83942d6b88a093d6b2d1f90386dfec |
Message: | atusb/fw/: aggregate interrupts while waiting - board_app.c (INT0_vect): always read IRQ_STATUS, even if an interrupt is already enqueued - board_app.c (INT0_vect): if an interrupt is enqueued, accumulate the interrupts signaled since - board_app.c (irqs_more): when a pending transfer completes, send interrupts accumulated since (if any) |
Files: |
atusb/fw/board_app.c (1 diff) |
Change Details
atusb/fw/board_app.c | ||
---|---|---|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
147 | ISR(INT0_vect) | |
147 | static uint8_t irqs = 0; | |
148 | ||
149 | ||
150 | static void irqs_more(void *user) | |
148 | 151 | { |
149 | static uint8_t irq; | |
152 | static uint8_t buf; | |
150 | 153 | |
151 | if (eps[1].state != EP_IDLE) | |
154 | if (!irqs) | |
152 | 155 | return; |
156 | buf = irqs; | |
157 | usb_send(&eps[1], &buf, 1, irqs_more, NULL); | |
158 | irqs = 0; | |
159 | } | |
160 | ||
161 | ||
162 | ISR(INT0_vect) | |
163 | { | |
153 | 164 | spi_begin(); |
154 | 165 | spi_send(AT86RF230_REG_READ | REG_IRQ_STATUS); |
155 | irq = spi_recv(); | |
166 | irqs |= spi_recv(); | |
156 | 167 | spi_end(); |
157 | usb_send(&eps[1], &irq, 1, NULL, NULL); | |
168 | if (eps[1].state == EP_IDLE) | |
169 | irqs_more(NULL); | |
158 | 170 | } |
159 | 171 | |
160 | 172 |