Date:2011-06-21 01:46:52 (9 years 1 month ago)
Author:Werner Almesberger
Commit:9952a20fdaf2913d880d2a0e96064617ac9d9ebe
Message: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.
Files: tools/lib/atben.c (1 diff)

Change Details

tools/lib/atben.c
388388{
389389    struct timeout to;
390390    int timedout;
391    uint8_t irq;
391392
392393    timeout_start(&to, timeout_ms);
393394    while (1) {
394395        timedout = timeout_reached(&to);
395        if (atben_interrupt(handle))
396            return atben_reg_read(handle, REG_IRQ_STATUS);
396        if (atben_interrupt(handle)) {
397            irq = atben_reg_read(handle, REG_IRQ_STATUS);
398            if (irq)
399                return irq;
400            fprintf(stderr, "ignoring stray interrupt\n");
401        }
397402        if (timedout)
398403            return 0;
399404        usleep(1000);

Archive Download the corresponding diff file



interactive