From 1fb05c221dcff657e49cc766e8ff7baa1d3434fc Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 19 Jan 2011 17:43:01 -0300 Subject: [PATCH] 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". --- tools/lib/misctxrx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/lib/misctxrx.c b/tools/lib/misctxrx.c index f463b01..9ad5754 100644 --- a/tools/lib/misctxrx.c +++ b/tools/lib/misctxrx.c @@ -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");