]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
adjusted to readout of other subsystems (new function get_endOfData())
authorhadaq <hadaq>
Mon, 27 May 2002 21:23:41 +0000 (21:23 +0000)
committerhadaq <hadaq>
Mon, 27 May 2002 21:23:41 +0000 (21:23 +0000)
W.Koenig

hadaq/hwtip.h

index 244ab79aceaaa5d8d9c438f261c9fdb40d88785a..3d90b333466a7f8963016edba1a12c64d6e006be 100644 (file)
@@ -4,25 +4,38 @@
 #include <lvme.h>
 
 #include <allParam.h>
+#include "tof_defs.h"
 
 typedef struct HwTipS {
-  char name[16];
+  char name[12];
   LVme *lvme;
-  unsigned long  currAddr;
-  unsigned long bankRequested;
-  unsigned long pipeFull;
-  unsigned long daqRq;
-  unsigned long daqGr;
-  unsigned long fifo;
+  int bankRequested;
+  int daqRq;
+  int daqGr;
+  int currAddr;
+  int fifo;
+  int endOfData;
 } HwTip;
 
 
 int conHwTip(HwTip *my, const char *name, const Param *param);
 void desHwTip(HwTip *my);
 
+static int HwTip_isBusy(HwTip * my)
+{
+       return !LVme_tstBitL(my->lvme, CONFIG1BASE + CFG_MASTER_STATUS, my->daqGr);
+}
+static void HwTip_getEndOfData(HwTip * my)
+{
+       my->endOfData = LVme_getL(my->lvme, my->fifo) + my->fifo;
+}
+
+static int HwTip_isEmpty(HwTip * my)
+{
+       return my->currAddr >= my->endOfData;
+}
+
 void HwTip_requestBuffer(HwTip *my);
-int HwTip_isBusy(HwTip *my);
-int HwTip_isEmpty(HwTip *my);
 int HwTip_readSubEvt(HwTip *my, void *subEvt);
 
 #endif