From 70715a15d9fc9bc885337c67b43dccdccf6d9569 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 20 Jun 2011 22:11:29 -0300 Subject: [PATCH] tools/lib/atben.c (atben_interrupt_wait): don't time out if timeout_ms == 0 --- tools/lib/atben.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/lib/atben.c b/tools/lib/atben.c index 33e4bca..53fa518 100644 --- a/tools/lib/atben.c +++ b/tools/lib/atben.c @@ -387,12 +387,14 @@ static int atben_interrupt(void *handle) int atben_interrupt_wait(void *handle, int timeout_ms) { struct timeout to; - int timedout; + int timedout = 0; uint8_t irq; - timeout_start(&to, timeout_ms); + if (timeout_ms) + timeout_start(&to, timeout_ms); while (1) { - timedout = timeout_reached(&to); + if (timeout_ms) + timedout = timeout_reached(&to); if (atben_interrupt(handle)) { irq = atben_reg_read(handle, REG_IRQ_STATUS); if (irq)