Skip to content

Commit

Permalink
avoid magic 50
Browse files Browse the repository at this point in the history
clarify EVR time source priority
  • Loading branch information
mdavidsaver committed Aug 9, 2017
1 parent 08e6b01 commit 93bfffc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions evgMrmApp/src/evgMrm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ evgMrm::sendTimestamp() {

struct epicsTimeStamp ts;
epicsTime ntpTime, storedTime;
if(epicsTimeOK == generalTimeGetExceptPriority(&ts, 0, 50)) {
if(epicsTimeOK == generalTimeGetExceptPriority(&ts, 0, ER_PROVIDER_PRIORITY)) {
ntpTime = ts;
storedTime = (epicsTime)getTimestamp();

Expand Down Expand Up @@ -449,7 +449,7 @@ evgMrm::incrTimestamp() {

void
evgMrm::syncTimestamp() {
if(epicsTimeOK != generalTimeGetExceptPriority(&m_timestamp, 0, 50))
if(epicsTimeOK != generalTimeGetExceptPriority(&m_timestamp, 0, ER_PROVIDER_PRIORITY))
return;
/*
* Generally nano seconds should be close to zero.
Expand Down
2 changes: 1 addition & 1 deletion evgMrmApp/src/evgMrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class wdTimer : public epicsThreadRunable {
while(!timeout)
timeout = !m_evg->getTimerEvent()->wait(1 + evgAllowedTsGitter);

if(epicsTimeOK == generalTimeGetExceptPriority(&ts, 0, 50)) {
if(epicsTimeOK == generalTimeGetExceptPriority(&ts, 0, ER_PROVIDER_PRIORITY)) {
printf("Timestamping timeout\n");
((epicsTime)ts).show(1);
}
Expand Down
4 changes: 0 additions & 4 deletions evrApp/src/evrGTIF.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ extern "C" {
* of the EVR interface for use with generalTime.
*/

/** @brief Priority given to EVR's timestamp/event provider
*/
#define ER_PROVIDER_PRIORITY 50

/* Must be called before other functions. Returns non-zero on error */
epicsShareFunc
int EVRInitTime();
Expand Down
2 changes: 1 addition & 1 deletion evrFRIBApp/src/evr_frib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ EVRFRIB::EVRFRIB(const std::string& s,
case FWInfo_Flavor_EVG:
{
epicsTimeStamp now;
if(epicsTimeOK == generalTimeGetExceptPriority(&now, 0, 50)) {
if(epicsTimeOK == generalTimeGetExceptPriority(&now, 0, ER_PROVIDER_PRIORITY)) {
// start simulated time from the present
timeoffset = POSIX_TIME_AT_EPICS_EPOCH + now.secPastEpoch - LE_READ32(base, TimeSec);
}
Expand Down
4 changes: 4 additions & 0 deletions mrfCommon/src/mrfCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ using std::auto_ptr;
#define MRF_EVENT_END_OF_SEQUENCE 0x7F


/** @brief Priority given to EVR's timestamp/event provider
*/
#define ER_PROVIDER_PRIORITY 50

/**************************************************************************************************/
/* MRF Supported Bus Types */
/**************************************************************************************************/
Expand Down

0 comments on commit 93bfffc

Please sign in to comment.