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:
parent
10b6d88af9
commit
70715a15d9
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user