]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
Join between hwrich-with-irq branch and main branch after testing
authorhades <hades>
Thu, 30 Aug 2001 09:06:48 +0000 (09:06 +0000)
committerhades <hades>
Thu, 30 Aug 2001 09:06:48 +0000 (09:06 +0000)
interrupt controlled readout of rich

hadaq/hwrich.c

index e5fe7828fa4f7967cd295d1c073153d9f950aab3..7c036ab5db3ad2b969d20919a70ab6c7db70c6cd 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.18 2001-04-12 12:33:19 hades Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.19 2001-08-30 09:06:48 hades Exp $";
 
 
 #define _POSIX_C_SOURCE 199309L
@@ -20,6 +20,7 @@ static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hada
 struct HardwareS {
        size_t maxSubEvtSize;
        HwRace *race[NRACES];
+       LInt *lInt[NRACES];
 };
 
 #include "hardware.h"
@@ -57,6 +58,8 @@ Hardware *newHardware(void)
                        msglog(LOG_ERR, "%s:%d:%s\n", __FILE__, __LINE__, strerror(errno));
                        return NULL;
                }
+               my->lInt[i] = allocMem(sizeof(LInt));
+               conLInt(my->lInt[i], 100 + i);
        }
 
        desParam(param);
@@ -68,6 +71,8 @@ void deleteHardware(Hardware *my)
        int i;
 
        for (i = 0; i < NRACES; i++) {
+               desLInt(my->lInt[i]);
+               freeMem(my->lInt[i]);
                desHwRace(my->race[i]);
                freeMem(my->race[i]);
        }
@@ -81,20 +86,12 @@ void Hardware_waitForTrigger(Hardware *my, void *subEvt)
        for (i = 0; i < NRACES; i++) {
                if (HwRace_isEmpty(my->race[i])) {
                        HwRace_requestBuffer(my->race[i]);
-               }
-       }
-       for (i = 0; i < NRACES; i++) {
-               while (HwRace_isBusy(my->race[i])) {
-#if 0
-/*
-* This sleep prevents a tight loop which stops work on real
-* time systems if the priority of readout is not lowered.
-* When not using the sleep use option -p -2 for daq_readout.
-*/
-               struct timespec tS, *t = &tS;
-               t->tv_sec = 0;
-               t->tv_nsec = 020000000;
-               nanosleep(t, NULL);
+#ifndef NDEBUG
+                       msglog(LOG_DEBUG, "%d buffer requested\n", i);
+#endif
+                       LInt_wait(my->lInt[i]);
+#ifndef NDEBUG
+                       msglog(LOG_DEBUG, "%d irq received\n", i);
 #endif
                }
        }