Date:2011-06-23 18:03:34 (8 years 2 months ago)
Author:Werner Almesberger
Commit:23c592250e0ff0cf86ae6c6be8b465faeef1bc44
Message:atusb/fw/board_app.c: do not read and accumulate IRQs; flash LED when EP1 busy

To indicate an interrupt, we just send a zero byte.
Files: atusb/fw/board_app.c (1 diff)

Change Details

atusb/fw/board_app.c
144144}
145145
146146
147static uint8_t irqs = 0;
148
149
150static void irqs_more(void *user)
147static void done(void *user)
151148{
152    static uint8_t buf;
153
154    if (!irqs)
155        return;
156    buf = irqs;
157    usb_send(&eps[1], &buf, 1, irqs_more, NULL);
158    irqs = 0;
149    led(0);
159150}
160151
161152
162153ISR(INT0_vect)
163154{
164    spi_begin();
165    spi_send(AT86RF230_REG_READ | REG_IRQ_STATUS);
166    irqs |= spi_recv();
167    spi_end();
168    if (eps[1].state == EP_IDLE)
169        irqs_more(NULL);
155    static uint8_t buf;
156
157    if (eps[1].state == EP_IDLE) {
158        led(1);
159        usb_send(&eps[1], &buf, 1, done, NULL);
160    }
170161}
171162
172163

Archive Download the corresponding diff file



interactive