From a6a60ef0de7f6f65aceaac69a0180978debc7413 Mon Sep 17 00:00:00 2001 From: hadaq Date: Tue, 1 Oct 2002 10:36:33 +0000 Subject: [PATCH] removed half-sector bug reported by Jurek, maximal length of ipc-subevent unknown, mt --- hadaq/hwship.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hadaq/hwship.c b/hadaq/hwship.c index ff626a4..854ef99 100644 --- a/hadaq/hwship.c +++ b/hadaq/hwship.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwship.c,v 6.21 2002-10-01 09:07:26 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwship.c,v 6.22 2002-10-01 10:36:33 hadaq Exp $"; #include #include @@ -92,14 +92,15 @@ int HwShip_readSubEvt(HwShip *my, void *subEvt) my->currAddr = lastAddr; /* skip empty subevent, nobody will realize this */ -#if 0 +#if 1 if (size <= SHIP_NODATASIZE) return 1; #endif /* copy one sub evt from RC to memory */ *data++ = size; i=0; - while ( ( (currAddr+=4) < lastAddr) && ( i < 400 ) ) { + /* we are not sure what the maximum number of words is allowed in the ipcs*/ + while ( ( (currAddr+=4) < lastAddr) && ( i < 0x1600 ) ) { *data++ = LVme_getL(my->lvme, currAddr); i++; } @@ -107,10 +108,10 @@ int HwShip_readSubEvt(HwShip *my, void *subEvt) if(size > 0x1900) { syslog(LOG_ERR,"Error, size too large: %.8x", size); - tempPtr = data-400; + tempPtr = data-0x1600; str[0] = 0; - for(i=0;i < 400; i++) { + for(i=0;i < 100; i++) { sprintf(buff, "%.8x ", tempPtr[i]); strcpy((char *) ((unsigned int)str + strlen(str)) , buff); if( ((i+1)%4) == 0) { @@ -122,15 +123,9 @@ int HwShip_readSubEvt(HwShip *my, void *subEvt) syslog(LOG_ERR, str); str[0] = 0; } - - - - } - - #ifndef NDEBUG syslog(LOG_DEBUG, "subEvt: %s", SubEvt_2charP(subEvt)); #endif -- 2.43.0