From da6b8b6921877bea73bd80145ed028c3c27ff68f Mon Sep 17 00:00:00 2001 From: Jerzy Jamroz Date: Thu, 14 Dec 2023 10:00:00 +0100 Subject: [PATCH] refactor: Risk of using a dummy epicsUTag minimilised. --- evrApp/src/evr/evr.h | 7 ++----- evrMrmApp/src/drvem.cpp | 2 ++ evrMrmApp/src/drvem.h | 15 +++++++++------ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/evrApp/src/evr/evr.h b/evrApp/src/evr/evr.h index 95588258..f42164cd 100644 --- a/evrApp/src/evr/evr.h +++ b/evrApp/src/evr/evr.h @@ -34,11 +34,6 @@ enum TSSource { TSSourceDBus4=2 }; -// Backward compatibility if UTAG is not supported by the epics-base. -#ifndef DBR_UTAG - typedef epicsUInt64 epicsUTag; -#endif - /**@brief Base interface for EVRs. * * This is the interface which the generic EVR device support @@ -196,6 +191,7 @@ class epicsShareClass EVR : public mrf::ObjectInst epicsUInt32 SourceTSraw() const{return (TSSource)SourceTS();}; /*@}*/ +#ifdef DBR_UTAG /**\defgroup utagman UTAG Management * * Get/Set UTAG value for specific event @@ -204,6 +200,7 @@ class epicsShareClass EVR : public mrf::ObjectInst virtual epicsUTag getUtag(const epicsUInt32 event) const {return 0;}; virtual void setUtag(epicsUTag tag, const epicsUInt32 event) {}; /*@}*/ +#endif private: bus_configuration busConfiguration; diff --git a/evrMrmApp/src/drvem.cpp b/evrMrmApp/src/drvem.cpp index 94e647a4..9bbce899 100644 --- a/evrMrmApp/src/drvem.cpp +++ b/evrMrmApp/src/drvem.cpp @@ -1568,6 +1568,7 @@ EVRMRM::seconds_tick(void *raw, epicsUInt32) } } +#ifdef DBR_UTAG // Get UTAG value for specific event epicsUTag EVRMRM::getUtag(const epicsUInt32 event) const { @@ -1589,3 +1590,4 @@ EVRMRM::setUtag(epicsUTag tag, const epicsUInt32 event) { events[event].utag = tag; return; } +#endif diff --git a/evrMrmApp/src/drvem.h b/evrMrmApp/src/drvem.h index c88890ab..46673363 100644 --- a/evrMrmApp/src/drvem.h +++ b/evrMrmApp/src/drvem.h @@ -73,15 +73,18 @@ struct eventCode { bool again; // UTAG associated to event +#ifdef DBR_UTAG epicsUTag utag; - +#endif eventCode():owner(0), interested(0), last_sec(0) - ,last_evt(0), waitingfor(0), again(false), - utag(0) + ,last_evt(0), waitingfor(0), again(false) +#ifdef DBR_UTAG + ,utag(0) +#endif { scanIoInit(&occured); // done_cb - initialized in EVRMRM::EVRMRM() - } + } }; /**@brief Modular Register Map Event Receivers @@ -196,10 +199,10 @@ class epicsShareClass EVRMRM : public mrf::ObjectInst, {SCOPED_LOCK(evrLock);return count_FIFO_sw_overrate;} virtual epicsUInt32 FIFOEvtCount() const OVERRIDE FINAL {return count_fifo_events;} virtual epicsUInt32 FIFOLoopCount() const OVERRIDE FINAL {return count_fifo_loops;} - +#ifdef DBR_UTAG virtual epicsUTag getUtag(const epicsUInt32 event) const OVERRIDE FINAL; virtual void setUtag(epicsUTag tag, const epicsUInt32 event) OVERRIDE FINAL; - +#endif void enableIRQ(void); bool dcEnabled() const;