From 8ada0bf0610c0d7e7944fdc904e8caec69f66610 Mon Sep 17 00:00:00 2001 From: hadaq Date: Thu, 13 Aug 2009 13:20:44 +0000 Subject: [PATCH] bug fix . --- libtrbnet/trbnet.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libtrbnet/trbnet.c b/libtrbnet/trbnet.c index fe247c7..366ee30 100644 --- a/libtrbnet/trbnet.c +++ b/libtrbnet/trbnet.c @@ -301,7 +301,7 @@ static void fifo_flush(uint8_t channel) read32_from_FPGA(fifoAddress, &tmp); /* DEBUG INFO */ if ((trb_debug > 1) && ((tmp & MASK_FIFO_VALID) != 0)) { - fprintf(stderr, "FIFO_%03d: 0x%08x\n", counter, tmp); + fprintf(stderr, "FLUSH_FIFO_%03d: 0x%08x\n", counter, tmp); counter++; } } while ((tmp & MASK_FIFO_VALID) != 0); @@ -417,8 +417,14 @@ static int trb_fifo_read(uint8_t channel, /* Read FIFO-Buffer, copy to User-Buffer */ while ((*tmp & MASK_FIFO_VALID) != 0) { - if (((*tmp & MASK_FIFO_TYPE) >> SHIFT_FIFO_TYPE) - == FIFO_TYPE_IS_HEADER) { + + /* DEBUG INFO */ + if (trb_debug > 1) { + fprintf(stderr, "FIFO_%03d: 0x%08x\n", + packageCtr * 5 + counter, *tmp); + } + + if (((*tmp & MASK_FIFO_TYPE) >> SHIFT_FIFO_TYPE) == FIFO_TYPE_IS_HEADER) { if ((counter % 5) == 0) { /* New Package begins */ if (trb_debug > 0) { @@ -465,12 +471,6 @@ static int trb_fifo_read(uint8_t channel, abort(); } - /* DEBUG INFO */ - if (trb_debug > 1) { - fprintf(stderr, "FIFO_%03d: 0x%08x\n", - packageCtr * 5 + counter, *tmp); - } - counter++; if (counter % 5 == 0) { -- 2.43.0