From: hadaq Date: Thu, 4 Jul 2002 22:15:23 +0000 (+0000) Subject: Somewhat improved wait for trigger handling. W.K. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=d37582e36159c618bcf8b9567cd78c37f8ca4164;p=daqdata.git Somewhat improved wait for trigger handling. W.K. --- diff --git a/hadaq/hwrace.h b/hadaq/hwrace.h index e75ba8d..4661939 100644 --- a/hadaq/hwrace.h +++ b/hadaq/hwrace.h @@ -8,21 +8,34 @@ typedef struct HwRaceS { char name[12]; - Rc *rc; - LVme_L *buf; - int bankRequested; + Rc * rc; + LVme_L * buf; int currAddr; + int endOfData; } HwRace; +#define RCPAGEBITSHIFT 8 +#define RCPAGESIZE 1 << RCPAGEBITSHIFT + int conHwRace(HwRace *my, const char *name, const Param *param); void desHwRace(HwRace *my); void HwRace_requestBuffer(HwRace *my); -int HwRace_isBusy(HwRace *my); -int HwRace_isEmpty(HwRace *my); + +static int HwRace_isEmpty(HwRace *my) +{ + return my->currAddr >= my->endOfData; +} + int HwRace_readSubEvt(HwRace *my, void *subEvt); + static int HwRace_isBufRequested(HwRace *my) { return my->currAddr == 0; } +static void HwRace_getEndOfData(HwRace *my) +{ + my->endOfData = (Rc_getPages(my->rc) << RCPAGEBITSHIFT); +} + #endif