From 1c802bcb71cc7c02010b9e2915eed48b77565fcc Mon Sep 17 00:00:00 2001 From: hades Date: Fri, 26 May 2000 18:14:25 +0000 Subject: [PATCH] *** empty log message *** --- hadaq/hwtip.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/hadaq/hwtip.c b/hadaq/hwtip.c index 804f7d6..d7782f3 100644 --- a/hadaq/hwtip.c +++ b/hadaq/hwtip.c @@ -65,7 +65,11 @@ void desHwTip(HwTip * my) } void HwTip_requestBuffer(HwTip *my) { - LVme_clrBitL(my->lvme, EXT_DAQ, my->daqRq); + + do { + LVme_clrBitL(my->lvme, EXT_DAQ, my->daqRq); + } while(LVme_tstBitL(my->lvme, EXT_DAQ, my->daqRq)); + while (LVme_tstBitL(my->lvme, EXT_STATUS, my->daqGr)) { #if 1 struct timespec tS, *t = &tS; @@ -97,7 +101,9 @@ void HwTip_requestBuffer(HwTip *my) { #endif } msglog(LOG_DEBUG, "data available\n"); - LVme_setBitL(my->lvme, EXT_DAQ, my->daqRq); + do { + LVme_setBitL(my->lvme, EXT_DAQ, my->daqRq); + } while(!LVme_tstBitL(my->lvme, EXT_DAQ, my->daqRq)); my->currAddr = my->fifo + 0x8; } @@ -116,21 +122,19 @@ int HwTip_readSubEvt(HwTip *my, void *subEvt) { size_t size; UInt1 trigTag; -#if 1 - size = LVme_getL(my->lvme, my->currAddr); + do { + size = LVme_getL(my->lvme, my->currAddr); + } while (size == 0xffffffff); /* copy one sub evt from RC to memory */ for (firstAddr = my->currAddr; my->currAddr - firstAddr < size; my->currAddr += 4) { - *data++ = LVme_getL(my->lvme, my->currAddr); + do { + *data = LVme_getL(my->lvme, my->currAddr); + } while (*data == 0xffffffff); + data++; } trigTag = SubEvt_trigNr(subEvt) & 0xff; -#else - my->currAddr = 0xffffffff; - SubEvt_setDecoding(subEvt, 0x00020001); - SubEvt_setSize(subEvt, 16); - SubEvt_setId(subEvt, 1); -#endif /* normal extension of trigger tag */ SubEvt_setTrigNr(subEvt, my->trigNr << 8 | trigTag); @@ -138,3 +142,7 @@ int HwTip_readSubEvt(HwTip *my, void *subEvt) { return 0; } + + + + -- 2.43.0