1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-26 04:56:16 +02:00

tools/lib/atben.c (atben_interrupt_wait): don't time out if timeout_ms == 0

This commit is contained in:
Werner Almesberger 2011-06-20 22:11:29 -03:00
parent 10b6d88af9
commit 70715a15d9

View File

@ -387,11 +387,13 @@ static int atben_interrupt(void *handle)
int atben_interrupt_wait(void *handle, int timeout_ms) int atben_interrupt_wait(void *handle, int timeout_ms)
{ {
struct timeout to; struct timeout to;
int timedout; int timedout = 0;
uint8_t irq; uint8_t irq;
if (timeout_ms)
timeout_start(&to, timeout_ms); timeout_start(&to, timeout_ms);
while (1) { while (1) {
if (timeout_ms)
timedout = timeout_reached(&to); timedout = timeout_reached(&to);
if (atben_interrupt(handle)) { if (atben_interrupt(handle)) {
irq = atben_reg_read(handle, REG_IRQ_STATUS); irq = atben_reg_read(handle, REG_IRQ_STATUS);