-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.18 2001-04-12 12:33:19 hades Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/Attic/hwrich.c,v 6.19 2001-08-30 09:06:48 hades Exp $";
#define _POSIX_C_SOURCE 199309L
struct HardwareS {
size_t maxSubEvtSize;
HwRace *race[NRACES];
+ LInt *lInt[NRACES];
};
#include "hardware.h"
msglog(LOG_ERR, "%s:%d:%s\n", __FILE__, __LINE__, strerror(errno));
return NULL;
}
+ my->lInt[i] = allocMem(sizeof(LInt));
+ conLInt(my->lInt[i], 100 + i);
}
desParam(param);
int i;
for (i = 0; i < NRACES; i++) {
+ desLInt(my->lInt[i]);
+ freeMem(my->lInt[i]);
desHwRace(my->race[i]);
freeMem(my->race[i]);
}
for (i = 0; i < NRACES; i++) {
if (HwRace_isEmpty(my->race[i])) {
HwRace_requestBuffer(my->race[i]);
- }
- }
- for (i = 0; i < NRACES; i++) {
- while (HwRace_isBusy(my->race[i])) {
-#if 0
-/*
-* This sleep prevents a tight loop which stops work on real
-* time systems if the priority of readout is not lowered.
-* When not using the sleep use option -p -2 for daq_readout.
-*/
- struct timespec tS, *t = &tS;
- t->tv_sec = 0;
- t->tv_nsec = 020000000;
- nanosleep(t, NULL);
+#ifndef NDEBUG
+ msglog(LOG_DEBUG, "%d buffer requested\n", i);
+#endif
+ LInt_wait(my->lInt[i]);
+#ifndef NDEBUG
+ msglog(LOG_DEBUG, "%d irq received\n", i);
#endif
}
}