mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 14:04:59 +02:00
tools/lib/atben.c (atben_interrupt_wait): don't time out if timeout_ms == 0
This commit is contained in:
parent
10b6d88af9
commit
70715a15d9
@ -387,12 +387,14 @@ 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;
|
||||||
|
|
||||||
timeout_start(&to, timeout_ms);
|
if (timeout_ms)
|
||||||
|
timeout_start(&to, timeout_ms);
|
||||||
while (1) {
|
while (1) {
|
||||||
timedout = timeout_reached(&to);
|
if (timeout_ms)
|
||||||
|
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);
|
||||||
if (irq)
|
if (irq)
|
||||||
|
Loading…
Reference in New Issue
Block a user