From: hadaq Date: Thu, 23 May 2002 16:55:13 +0000 (+0000) Subject: function ...getEndOfData added. Others modified. W. Koenig X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=63f119fa2d0a60351c8c132781aa0880af9cbc02;p=daqdata.git function ...getEndOfData added. Others modified. W. Koenig --- diff --git a/hadaq/hwship.h b/hadaq/hwship.h index 341ec0a..599212d 100644 --- a/hadaq/hwship.h +++ b/hadaq/hwship.h @@ -4,12 +4,13 @@ #include #include +#include "ipc_basis.h" typedef struct HwShipS { char name[12]; LVme *lvme; int currAddr; - unsigned trigNr; + int endOfData; int bankRequested; } HwShip; @@ -18,8 +19,27 @@ int conHwShip(HwShip *my, const char *name, const Param *param); void desHwShip(HwShip *my); void HwShip_requestBuffer(HwShip *my); -int HwShip_isBusy(HwShip *my); -int HwShip_isEmpty(HwShip *my); + +static int bankConfirmed(HwShip *my) { + return LVme_tstBitL(my->lvme, LVL2_ACCESS_VMEREG, 7); +} + +static void HwShip_getEndOfData(HwShip *my) { + my->endOfData = LVme_getL(my->lvme, LVL2_OFFSET) - 2 + LVL2_OFFSET; +} + +static int HwShip_isBusy(HwShip *my) { + return my->bankRequested != bankConfirmed(my); +} + +static int HwShip_isEmpty(HwShip *my) { + return my->currAddr >= my->endOfData; +} + +static int HwShip_isBufRequested(HwShip *my) { + return my->endOfData == 0; +} + int HwShip_readSubEvt(HwShip *my, void *subEvt); #endif