1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-25 17:43:09 +02:00

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.
This commit is contained in:
Werner Almesberger 2011-06-23 13:03:34 -03:00
parent 27fc0a0e2c
commit 23c592250e

View File

@ -144,29 +144,20 @@ void gpio_cleanup(void)
}
static uint8_t irqs = 0;
static void irqs_more(void *user)
static void done(void *user)
{
static uint8_t buf;
if (!irqs)
return;
buf = irqs;
usb_send(&eps[1], &buf, 1, irqs_more, NULL);
irqs = 0;
led(0);
}
ISR(INT0_vect)
{
spi_begin();
spi_send(AT86RF230_REG_READ | REG_IRQ_STATUS);
irqs |= spi_recv();
spi_end();
if (eps[1].state == EP_IDLE)
irqs_more(NULL);
static uint8_t buf;
if (eps[1].state == EP_IDLE) {
led(1);
usb_send(&eps[1], &buf, 1, done, NULL);
}
}