]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Somewhat improved wait for trigger handling. W.K.
authorhadaq <hadaq>
Thu, 4 Jul 2002 22:15:23 +0000 (22:15 +0000)
committerhadaq <hadaq>
Thu, 4 Jul 2002 22:15:23 +0000 (22:15 +0000)
hadaq/hwrace.h

index e75ba8d0856c838fdeaa8437d7ed794d4bf9b603..4661939f0d55b53d92eab55de4283a9b98cef8eb 100644 (file)
@@ -8,21 +8,34 @@
 
 typedef struct HwRaceS {
   char name[12];
-  Rc *rc;
-  LVme_L *buf;
-  int bankRequested;
+  Rc * rc;
+  LVme_L * buf;
   int currAddr;
+  int endOfData;
 } HwRace;
 
+#define RCPAGEBITSHIFT 8
+#define RCPAGESIZE 1 << RCPAGEBITSHIFT
+
 
 int conHwRace(HwRace *my, const char *name, const Param *param);
 void desHwRace(HwRace *my);
 
 void HwRace_requestBuffer(HwRace *my);
-int HwRace_isBusy(HwRace *my);
-int HwRace_isEmpty(HwRace *my);
+
+static int HwRace_isEmpty(HwRace *my)
+{
+       return my->currAddr >= my->endOfData;
+}
+
 int HwRace_readSubEvt(HwRace *my, void *subEvt);
+
 static int HwRace_isBufRequested(HwRace *my) {
        return my->currAddr == 0;
 }
+static void HwRace_getEndOfData(HwRace *my)
+{
+       my->endOfData = (Rc_getPages(my->rc) << RCPAGEBITSHIFT);
+}
+
 #endif