-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtrig.c,v 6.37 2003-05-14 13:54:44 muench Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwtrig.c,v 6.38 2003-07-09 16:13:09 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#include <unistd.h>
#include "hwtip.h"
/* Number of TOF crates */
-#define NCRATES 3
+#define NCRATES 1
#define MU_EVT_COUNT 0x0e8014UL
#define MU_FIFO 0x0000UL
syslog(LOG_DEBUG, "check if MU is ready");
/*
- only read the Matching Unit Count register, when all pending
- events are processed. This is recommended, because it is very
- "expensive" to read from an Sharc Register in the Matching Unit.
- */
+ only read the Matching Unit Count register, when all pending
+ events are processed. This is recommended, because it is very
+ "expensive" to read from an Sharc Register in the Matching Unit.
+ */
if (my->evtCount == my->old_evtCount) {
while ((my->old_evtCount = LVme_getL(my->lvme0, MU_EVT_COUNT)) == my->evtCount) {
LVme_getW(my->lvme4, MU_FIFO);
}
/*
- old MU assumes its 16 bit words get expanded to 32 Bit.
- This is not the case, see SubEvt_setDecoding(..)
- */
+ old MU assumes its 16 bit words get expanded to 32 Bit.
+ This is not the case, see SubEvt_setDecoding(..)
+ */
*header = ((LVme_getW(my->lvme4, MU_FIFO) & 0xffff) >> 1) + 8;
/*
- *header contains subevent size in char's.
- It is added to the pointer to evt begin.
- */
+ *header contains subevent size in char's.
+ It is added to the pointer to evt begin.
+ */
dataEnd = (uint16_t *) ((uint32_t) header + *header);
*++header = LVme_getW(my->lvme4, MU_FIFO) & 0xffff;
data += (header & 0xfff) - 1;
}
- *subEvtInfo = header >> 16;
+ *subEvtInfo = (header >> 16) | ((trigCode << 12) & 0xff000);
SubEvt_setSize(subEvt, (char *) data - (char *) subEvt);
+
subEvt = SubEvt_next(partEvt, subEvt);
}
if (dataError) {