Skip to content

Commit

Permalink
refactor: Risk of using a dummy epicsUTag minimilised.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzyjamroz committed Dec 14, 2023
1 parent 14a7f29 commit da6b8b6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
7 changes: 2 additions & 5 deletions evrApp/src/evr/evr.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -196,6 +191,7 @@ class epicsShareClass EVR : public mrf::ObjectInst<EVR>
epicsUInt32 SourceTSraw() const{return (TSSource)SourceTS();};
/*@}*/

#ifdef DBR_UTAG
/**\defgroup utagman UTAG Management
*
* Get/Set UTAG value for specific event
Expand All @@ -204,6 +200,7 @@ class epicsShareClass EVR : public mrf::ObjectInst<EVR>
virtual epicsUTag getUtag(const epicsUInt32 event) const {return 0;};
virtual void setUtag(epicsUTag tag, const epicsUInt32 event) {};
/*@}*/
#endif

private:
bus_configuration busConfiguration;
Expand Down
2 changes: 2 additions & 0 deletions evrMrmApp/src/drvem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -1589,3 +1590,4 @@ EVRMRM::setUtag(epicsUTag tag, const epicsUInt32 event) {
events[event].utag = tag;
return;
}
#endif
15 changes: 9 additions & 6 deletions evrMrmApp/src/drvem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -196,10 +199,10 @@ class epicsShareClass EVRMRM : public mrf::ObjectInst<EVRMRM, EVR>,
{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;
Expand Down

0 comments on commit da6b8b6

Please sign in to comment.