From: hades Date: Thu, 2 Sep 1999 11:19:15 +0000 (+0000) Subject: readout whole tof crate X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=ccfc665fc089acafd0372982e50a844553514029;p=daqdata.git readout whole tof crate --- diff --git a/hadaq/hwtof.c b/hadaq/hwtof.c index a5fd2cf..be1d0cf 100644 --- a/hadaq/hwtof.c +++ b/hadaq/hwtof.c @@ -1,4 +1,4 @@ -static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtof.c,v 1.3 1999-09-02 09:24:30 hades Exp $"; +static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtof.c,v 1.4 1999-09-02 11:19:15 hades Exp $"; #define _POSIX_C_SOURCE 199309L #include @@ -106,18 +106,21 @@ void deleteHardware(Hardware *my) void Hardware_waitForTrigger(const Hardware *my, void *subEvt) { HwV775 **v775 = ((Modules *) my->specific)->v775; + static UInt1 trigTag = 0; + static unsigned long trigNr = 0; - if (HwV775_isEmpty(v775[0])) { - HwV775_requestBuffer(v775[0]); - while (HwV775_isBusy(v775[0])) { + while (HwV775_isEmpty(v775[0])) { #if 1 - struct timespec tS, *t = &tS; - t->tv_sec = 0; - t->tv_nsec = 020000000; - nanosleep(t, NULL); + struct timespec tS, *t = &tS; + t->tv_sec = 0; + t->tv_nsec = 020000000; + nanosleep(t, NULL); #endif - } } + SubEvt_setSize(subEvt, SubEvt_hdrSize()); + SubEvt_setDecoding(subEvt, SubEvtDecoding_32bitData); + SubEvt_setTrigNr(subEvt, trigNr << 24 | trigTag); + SubEvt_setId(subEvt, SubEvtId_tofTest); } void Hardware_readout(const Hardware *my, void *subEvt) @@ -125,20 +128,11 @@ void Hardware_readout(const Hardware *my, void *subEvt) int i; HwV775 **v775 = ((Modules *) my->specific)->v775; HwV878 **v878 = ((Modules *) my->specific)->v878; - void *currSubEvt; - - for ( - i = 0, currSubEvt = subEvt; - i < NV775S; - i++, currSubEvt = SubEvt_end(subEvt) - ) { - HwV775_readSubEvt(v775[i], currSubEvt); + + for (i = 0; i < NV775S; i++) { + HwV775_readData(v775[i], subEvt); } - for ( - i = 0, currSubEvt = subEvt; - i < NV878S; - i++, currSubEvt = SubEvt_end(subEvt) - ) { - HwV878_readSubEvt(v878[i], currSubEvt); + for (i = 0; i < NV878S; i++) { + HwV878_readData(v878[i], subEvt); } }