1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-05 04:48:26 +02:00

misctxrx.c (wait_for_interrupt): let "ignore" control printing more tightly

When some interrupt(s) happened but the one(s) wait_for_interrupt was
waiting for weren't among them, it printed the list of interrupts
even if they were all in "ignore". This made sequences like RX_START
followed by TRX_END unnecessarily noisy.

Now, wait_for_interrupt only prints the pending interrupts if at
least one of them is not in "ignore".
This commit is contained in:
Werner Almesberger 2011-01-19 17:43:01 -03:00
parent 96e8fc6dbf
commit 1fb05c221d

View File

@ -53,8 +53,11 @@ uint8_t wait_for_interrupt(struct atrf_dsc *dsc, uint8_t wait_for,
if (!irq)
continue;
show = irq & ~ignore;
if ((irq & wait_for) && !show)
break;
if (!show) {
if (irq & wait_for)
break;
continue;
}
fprintf(stderr, "IRQ (0x%02x):", irq);
if (irq & IRQ_PLL_LOCK)
fprintf(stderr, " PLL_LOCK");