mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 18:35:54 +02:00
tools/lib/atben.c (atben_interrupt_wait): complain about stray interrupts
If INT_RF is high but IRQ_STATUS is clear, something strange is happening. We complain but continue waiting.
This commit is contained in:
parent
b7276d282a
commit
9952a20fda
@ -388,12 +388,17 @@ int atben_interrupt_wait(void *handle, int timeout_ms)
|
||||
{
|
||||
struct timeout to;
|
||||
int timedout;
|
||||
uint8_t irq;
|
||||
|
||||
timeout_start(&to, timeout_ms);
|
||||
while (1) {
|
||||
timedout = timeout_reached(&to);
|
||||
if (atben_interrupt(handle))
|
||||
return atben_reg_read(handle, REG_IRQ_STATUS);
|
||||
if (atben_interrupt(handle)) {
|
||||
irq = atben_reg_read(handle, REG_IRQ_STATUS);
|
||||
if (irq)
|
||||
return irq;
|
||||
fprintf(stderr, "ignoring stray interrupt\n");
|
||||
}
|
||||
if (timedout)
|
||||
return 0;
|
||||
usleep(1000);
|
||||
|
Loading…
Reference in New Issue
Block a user