-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.21 2001-11-18 13:10:35 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.22 2002-04-19 19:11:01 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
size_t maxSubEvtSize;
HwRace *race[NRACES];
LInt *lInt[NRACES];
+ LVme *dtu;
};
#include "hardware.h"
}
my->lInt[i] = malloc(sizeof(LInt));
conLInt(my->lInt[i], 100 + i);
+
+ }
+ my->dtu = malloc(sizeof(LVme));
+ if(0 > conLVme(my->dtu, 0x44100000, 0x10000, 0x09, 0x3c, 1)) {
+ syslog(LOG_DEBUG,"Rich DTU not found");
+ return -1;
}
desParam(param);
desHwRace(my->race[i]);
free(my->race[i]);
}
+ desLVme(my->dtu);
+ free(my->dtu);
+
free(my);
}
{
int i;
+ LVme_setL(my->dtu,0x00 ,0x22); /* dtu busy on */
for (i = 0; i < NRACES; i++) {
if (HwRace_isEmpty(my->race[i])) {
HwRace_requestBuffer(my->race[i]);
#ifndef NDEBUG
syslog(LOG_DEBUG, "%d buffer requested", i);
#endif
+ }
+ }
+ LVme_setL(my->dtu,0x00 ,0x02); /* dtu busy off */
+ for (i = 0; i < NRACES; i++) {
+ if(HwRace_BufIsRequested(my->race[i])) {
LInt_wait(my->lInt[i]);
#ifndef NDEBUG
syslog(LOG_DEBUG, "%d irq received", i);
SubEvt_setId(partEvt, 0);
/* read all races, check for common trigger tag */
+ LVme_setL(my->dtu,0x00 ,0x22); /* dtu busy on */
for (i = 0; i < NRACES; i++) {
HwRace_readSubEvt(my->race[i], subEvt);
if (i == 0) {
}
subEvt = SubEvt_next(partEvt, subEvt);
}
+ LVme_setL(my->dtu,0x00 ,0x02); /* dtu busy off */
- SubEvt_setTrigNr(partEvt, trigNr << 8 | trigTag);
+ SubEvt_setTrigNr(partEvt, trigNr << 8 | trigTag);
SubEvt_setSize(partEvt, (char *)subEvt - (char *)partEvt);
trigNr++;