]> jspc29.x-matter.uni-frankfurt.de Git - trbnettools.git/commitdiff
bug fix
authorhadaq <hadaq>
Thu, 13 Aug 2009 13:20:44 +0000 (13:20 +0000)
committerhadaq <hadaq>
Thu, 13 Aug 2009 13:20:44 +0000 (13:20 +0000)
.

libtrbnet/trbnet.c

index fe247c7fb378c35cabe5ead30e41e41f22d736a8..366ee305c5811d6920641146529c52de0615c511 100644 (file)
@@ -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) {