From 1b9971550a036c8d53a82e6adf7a73960775e405 Mon Sep 17 00:00:00 2001 From: hadaq Date: Wed, 6 Nov 2002 18:36:04 +0000 Subject: [PATCH] was working with beam on 02-11-05, wk --- hadaq/hwsam.c | 49 ++++++------------------------------------------- 1 file changed, 6 insertions(+), 43 deletions(-) diff --git a/hadaq/hwsam.c b/hadaq/hwsam.c index 0c109ae..a956ace 100644 --- a/hadaq/hwsam.c +++ b/hadaq/hwsam.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwsam.c,v 6.14 2002-10-27 12:26:49 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwsam.c,v 6.15 2002-11-06 18:36:04 hadaq Exp $"; #include #include @@ -97,15 +97,12 @@ void HwSam_getEndOfData(HwSam *my) /* 5 RC Headers + Subevent Header + some data */ #define SAM_NODATASIZE 0 -#define RC_HEADERLENGTH 12 int HwSam_readSubEvt(HwSam *my, void *subEvt) { - uint32_t * dataStart = (uint32_t *) subEvt; - uint32_t * data; + uint32_t * data = (uint32_t *) subEvt; int lastAddr; int currAddr = my->currAddr; - int size, rcSize; - int rcSubEvt; /* pointer to length in rc sub-sub-event header */ + int size; #ifndef NDEBUG syslog(LOG_DEBUG, "readSubEvt in"); @@ -127,44 +124,10 @@ int HwSam_readSubEvt(HwSam *my, void *subEvt) syslog(LOG_DEBUG, "readSubEvt subevt: %s", SubEvt_2charP(subEvt)); #endif /* copy one sub evt from Sam to memory */ - data = dataStart; - /* copy remaining header */ - *++data = LVme_getL(my->cram, currAddr+=4); - *++data = LVme_getL(my->cram, currAddr+=4); - *++data = LVme_getL(my->cram, currAddr+=4); - - rcSubEvt = (currAddr+=4); - while (rcSubEvt < lastAddr) { - /* - Skip rc subevent header if no data: tag, length, rc-id. - This hack belongs into the RC code - where tags should be compared to internal counters. - If inconsistent, debug data can be inserted marked by the - upermost bit on. - */ - int rcSize16; - rcSize = LVme_getL(my->cram, currAddr+4); - rcSize16 = rcSize & 0xffff; - rcSubEvt += rcSize16 * 4 + RC_HEADERLENGTH; - -/* if no data ... cut roc header */ -/* - if( rcSize16 == 0) { - size -= RC_HEADERLENGTH; - currAddr += RC_HEADERLENGTH; - } else { -*/ - *++data = LVme_getL(my->cram, currAddr); - *++data = rcSize; - *++data = LVme_getL(my->cram, currAddr+=8); - while((currAddr+=4) < rcSubEvt) { - *++data = LVme_getL(my->cram, currAddr); - } -/* - } -*/ + *data++ = size; + while ((currAddr+=4)cram, currAddr); } - *dataStart = size; #ifndef NDEBUG syslog(LOG_DEBUG, "readSubEvt out"); -- 2.43.0