From: hades Date: Sun, 5 Sep 1999 11:19:08 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=9cc34e5b15775204c9c0a2b498a0699f745f3a90;p=daqdata.git *** empty log message *** --- diff --git a/hadaq/ctrlctu.c b/hadaq/ctrlctu.c index 25bc6f0..f4bb30d 100644 --- a/hadaq/ctrlctu.c +++ b/hadaq/ctrlctu.c @@ -1,17 +1,14 @@ #include +#include #include #include #include #include -#include -#include - #include -#include "ctu.h" #include "worker.h" static jmp_buf terminateJmp; @@ -29,14 +26,12 @@ static void usage(const char *progName) int main(int argc, char *argv[]) { - Ctu *ctu; Worker *worker; int isStandalone; int priority; ptrdiff_t offset; int i; unsigned long value; - struct pdparam_master paramS, *param = ¶mS; int oper; unsigned long *ctuEnabled; @@ -65,7 +60,7 @@ int main(int argc, char *argv[]) } } - if (NULL == (worker = Worker_init(argv[0], sigHandler, priority, isStandalone))) { + if (NULL == (worker = Worker_initBegin(argv[0], sigHandler, priority, isStandalone))) { msglog(LOG_ERR, "connecting to agent: %s\n", strerror(errno)); goto bailOut0; } @@ -73,42 +68,19 @@ int main(int argc, char *argv[]) msglog(LOG_ERR, "addingStatistic: %s\n", strerror(errno)); goto bailOut0; } - param->iack = 1; - param->rdpref = 0; - param->wrpost = 0; - param->swap = 1; + Worker_initEnd(worker); - ctu = allocMem(sizeof(Ctu)); - if (-1 == conCtu(ctu, 0x44000000)) { - msglog(LOG_ERR, "Initializing Ctu: %s\n", strerror(errno)); - exit(EXIT_FAILURE); - } - Ctu_softBusy(ctu, 1); - (*ctuEnabled) = 0; - Ctu_clear(ctu); - Ctu_wrDeadtime(ctu, 0x08); - Ctu_wrDelay(ctu, 0x08); - Ctu_inhibit(ctu, 1); - Ctu_maskTrig(ctu, 1); - Ctu_softBusy(ctu, 0); + system("ctuctrl reset"); + system("ctuctrl rate 1"); + system("ctuctrl start"); (*ctuEnabled) = 1; - Ctu_softTrig(ctu, 0x10); - Ctu_maskTrig(ctu, 0); - msglog(LOG_DEBUG, "%s\n", Ctu_2charP(ctu)); if (0 == setjmp(terminateJmp)) { sleep(32767); } - Ctu_maskTrig(ctu, 1); - Ctu_softTrig(ctu, 0x20); - msglog(LOG_DEBUG, "%s\n", Ctu_2charP(ctu)); - Ctu_softBusy(ctu, 1); - Ctu_maskTrig(ctu, 0); - Ctu_inhibit(ctu, 0); + system("ctuctrl stop"); (*ctuEnabled) = 0; - desCtu(ctu); Worker_fini(worker); - freeMem(ctu); exit(0); diff --git a/hadaq/hwdtu.c b/hadaq/hwdtu.c index fd7b079..a6c9969 100644 --- a/hadaq/hwdtu.c +++ b/hadaq/hwdtu.c @@ -1,4 +1,4 @@ -static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwdtu.c,v 1.1 1999-09-03 07:35:06 hades Exp $"; +static char rcsId[] = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwdtu.c,v 1.2 1999-09-05 11:20:08 hades Stab $"; #define _POSIX_C_SOURCE 199309L #include @@ -42,16 +42,16 @@ void desHwDtu(HwDtu *my) freeMem(my->lvme); } -int HwDTU_isEmpty(HwDtu *my) +int HwDtu_isEmpty(HwDtu *my) { - return LVme_tstBitB(my->lvme, DTU_FIFO_2, 0); + return LVme_tstBitL(my->lvme, DTU_FIFO_2, 0); } -int HwDTU_read(HwDtu *my, void *subEvt) +int HwDtu_read(HwDtu *my) { - my->trigTag = LVme_getB(my->lvme, DTU_TRIG_TAG); - my->trigCode = LVme_getB(my->lvme, DTU_TRIG_CODE) & 0x0f; - LVme_setB(my->lvme, DTU_FIFO_1, 0); - LVme_setB(my->lvme, DTU_FIFO_2, 0); + my->trigTag = LVme_getL(my->lvme, DTU_TRIG_TAG); + my->trigCode = LVme_getL(my->lvme, DTU_TRIG_CODE) & 0x0f; + LVme_setL(my->lvme, DTU_FIFO_1, 0); + LVme_setL(my->lvme, DTU_FIFO_2, 0); return 0; }