]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Sun, 5 Sep 1999 11:19:08 +0000 (11:19 +0000)
committerhades <hades>
Sun, 5 Sep 1999 11:19:08 +0000 (11:19 +0000)
hadaq/ctrlctu.c
hadaq/hwdtu.c

index 25bc6f094dcc7a359a40bcbfec9af410834b4030..f4bb30df3f0eac3272bd091701d64a8c7275c199 100644 (file)
@@ -1,17 +1,14 @@
 
 #include <stddef.h>
 
+#include <errno.h>
 #include <setjmp.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <signal.h>
 
-#include <types.h>
-#include <ces/vmelib.h>
-
 #include <hadesstd.h>
 
-#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 = &paramS;
        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);
 
index fd7b079b63030a88eb1496794b9fe6358860b80e..a6c9969528a896a1e1b908eddd9b61321fae2ac2 100644 (file)
@@ -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 <unistd.h>
@@ -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;
 }