From f1d92e211846459623896647412dbc770e02064e Mon Sep 17 00:00:00 2001 From: hadaq Date: Mon, 27 May 2002 21:23:41 +0000 Subject: [PATCH] adjusted to readout of other subsystems (new function get_endOfData()) W.Koenig --- hadaq/hwtip.h | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/hadaq/hwtip.h b/hadaq/hwtip.h index 244ab79..3d90b33 100644 --- a/hadaq/hwtip.h +++ b/hadaq/hwtip.h @@ -4,25 +4,38 @@ #include #include +#include "tof_defs.h" typedef struct HwTipS { - char name[16]; + char name[12]; LVme *lvme; - unsigned long currAddr; - unsigned long bankRequested; - unsigned long pipeFull; - unsigned long daqRq; - unsigned long daqGr; - unsigned long fifo; + int bankRequested; + int daqRq; + int daqGr; + int currAddr; + int fifo; + int endOfData; } HwTip; int conHwTip(HwTip *my, const char *name, const Param *param); void desHwTip(HwTip *my); +static int HwTip_isBusy(HwTip * my) +{ + return !LVme_tstBitL(my->lvme, CONFIG1BASE + CFG_MASTER_STATUS, my->daqGr); +} +static void HwTip_getEndOfData(HwTip * my) +{ + my->endOfData = LVme_getL(my->lvme, my->fifo) + my->fifo; +} + +static int HwTip_isEmpty(HwTip * my) +{ + return my->currAddr >= my->endOfData; +} + void HwTip_requestBuffer(HwTip *my); -int HwTip_isBusy(HwTip *my); -int HwTip_isEmpty(HwTip *my); int HwTip_readSubEvt(HwTip *my, void *subEvt); #endif -- 2.43.0