]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
might contain some improvements. Committed just in case. W. Koenig
authorhadaq <hadaq>
Fri, 19 Apr 2002 19:08:58 +0000 (19:08 +0000)
committerhadaq <hadaq>
Fri, 19 Apr 2002 19:08:58 +0000 (19:08 +0000)
hadaq/hwtrig.c

index 928b66c79ac4c09578012564ea30f77237e8d62d..227932ed7ec9210a88826d09cc720e13c64f4900 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtrig.c,v 6.24 2002-04-07 17:06:46 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtrig.c,v 6.25 2002-04-19 19:08:58 hadaq Exp $";
 /* modified MU readout producing a dense pack of 16 Bit words. 15-March-2002, W. Koenig */
 
 #define _POSIX_C_SOURCE 199309L
@@ -24,7 +24,7 @@ static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hada
 #endif
 
 /* Number of TOF crates */
-#define NCRATES 
+#define NCRATES 3
 
 #define MU_EVT_COUNT    0x0e8014UL
 #define MU_FIFO         0x0000UL
@@ -66,14 +66,14 @@ Hardware *newHardware(void)
        int paramWasFound;
        Param *param;
 
-       my = malloc(sizeof(Hardware));
-       my->maxSubEvtSize = (SubEvt_hdrSize() + 2 * 500 * sizeof(uint32_t)) /* MU */
+       my = (Hardware *)malloc(sizeof(Hardware));
+       my->maxSubEvtSize = (SubEvt_hdrSize() + 2 * 500 * sizeof(uint16_t)) /* MU */
                + ( NCRATES * ( SubEvt_hdrSize() +  620 * sizeof(uint32_t))); /* CONC */
 
        my->evtCount = 0;
        my->old_evtCount = 0;
 
-       param = malloc(sizeof(Param));
+       param = (Param *)malloc(sizeof(Param));
        conParam(param);
        Param_getInt(param, "mu", "cardbase", &paramWasFound, &cardBase);
        syslog(LOG_INFO, "MU cardbase %.8x", cardBase );
@@ -83,24 +83,24 @@ Hardware *newHardware(void)
                cardBase = 0;
        }
 
-       my->lvme0 = malloc(sizeof(LVme));
+       my->lvme0 = (LVme *)malloc(sizeof(LVme));
        if (0 > conLVme(my->lvme0, cardBase, 0x100000UL, 0x09UL, 0, 0)) {
          syslog(LOG_ERR, "MU on %p not found", cardBase);
          return NULL;
        }
-       my->lvme4 = malloc(sizeof(LVme));
+       my->lvme4 = (LVme *)malloc(sizeof(LVme));
        if (0 > conLVme(my->lvme4, cardBase + 0x4000000, 0x10000UL, 0x09UL, 0, 0)) {
          syslog(LOG_ERR, "MU on %p not found", cardBase);
          return NULL;
        }
-       my->lvme6 = malloc(sizeof(LVme));
+       my->lvme6 = (LVme *)malloc(sizeof(LVme));
        if (0 > conLVme(my->lvme6, cardBase + 0x6000000, 0x10000UL, 0x09UL, 0, 0)) {
          syslog(LOG_ERR, "MU on %p not found", cardBase);
          return NULL;
        }
 
 #ifdef TOF_READOUT
-       my->tip = malloc(sizeof(HwTip));
+       my->tip = (HwTip *) malloc(sizeof(HwTip));
        if (0 > conHwTip(my->tip, "conc", param)) {
                syslog(LOG_ERR, "%s:%d:%s", __FILE__, __LINE__, strerror(errno));
                return NULL;
@@ -203,7 +203,7 @@ void readoutTrig(Hardware *my, void *subEvt)
        *header++ = LVme_getW(my->lvme4, MU_FIFO) & 0xffff;
        SubEvt_setDecoding(subEvt, SubEvtDecoding_16bitData);
 
-       data=header;
+       data=(uint16_t *)header;
        dataEnd=(uint16_t *)SubEvt_end(subEvt);
 
        while (data < dataEnd) {