committed this fix
=== modified file 'src/libCom/osi/os/WIN32/osdTime.cpp' --- src/libCom/osi/os/WIN32/osdTime.cpp 2011-11-10 21:03:01 +0000 +++ src/libCom/osi/os/WIN32/osdTime.cpp 2011-11-10 21:47:18 +0000 @@ -303,8 +303,8 @@ } else { errlogPrintf ( - "win32 osdTime.cpp detected questionable " - "system date prior to EPICS epoch\n" ); + "win32 osdTime.cpp init detected questionable " + "system date prior to EPICS epoch, epics time will not advance\n" ); this->epicsTimeLast = 0; }
@@ -483,9 +483,32 @@ / this->perfCounterFreq; this->lastPerfCounter = curPerfCounter.QuadPart;
- LONGLONG epicsTimeFromCurrentFileTime = - ( curFileTime.QuadPart - epicsEpochInFileTime ) * - ET_TICKS_PER_FT_TICK; + LONGLONG epicsTimeFromCurrentFileTime; + + { + static bool firstMessageWasSent = false; + if ( curFileTime.QuadPart >= epicsEpochInFileTime ) { + epicsTimeFromCurrentFileTime = + ( curFileTime.QuadPart - epicsEpochInFileTime ) * + ET_TICKS_PER_FT_TICK; + firstMessageWasSent = false; + } + else { + /* + * if the system time jumps to before the EPICS epoch + * then latch to the EPICS epoch printing only one + * warning message the first time that the issue is + * detected + */ + if ( ! firstMessageWasSent ) { + errlogPrintf ( + "win32 osdTime.cpp time PLL update detected questionable " + "system date prior to EPICS epoch, epics time will not advance\n" ); + firstMessageWasSent = true; + } + epicsTimeFromCurrentFileTime = 0; + } + }
delta = epicsTimeFromCurrentFileTime - this->epicsTimeLast; if ( delta > EPICS_TIME_TICKS_PER_SEC || delta < -EPICS_TIME_TICKS_PER_SEC ) {
committed this fix
=== modified file 'src/libCom/ osi/os/ WIN32/osdTime. cpp' osi/os/ WIN32/osdTime. cpp 2011-11-10 21:03:01 +0000 osi/os/ WIN32/osdTime. cpp 2011-11-10 21:47:18 +0000
errlogPrintf (
this- >epicsTimeLast = 0;
--- src/libCom/
+++ src/libCom/
@@ -303,8 +303,8 @@
}
else {
- "win32 osdTime.cpp detected questionable "
- "system date prior to EPICS epoch\n" );
+ "win32 osdTime.cpp init detected questionable "
+ "system date prior to EPICS epoch, epics time will not advance\n" );
}
@@ -483,9 +483,32 @@ erFreq; >lastPerfCounte r = curPerfCounter. QuadPart;
/ this->perfCount
this-
- LONGLONG epicsTimeFromCu rrentFileTime = QuadPart - epicsEpochInFil eTime ) * PER_FT_ TICK; rrentFileTime; QuadPart >= epicsEpochInFil eTime ) { rrentFileTime = QuadPart - epicsEpochInFil eTime ) * PER_FT_ TICK; rrentFileTime = 0;
- ( curFileTime.
- ET_TICKS_
+ LONGLONG epicsTimeFromCu
+
+ {
+ static bool firstMessageWasSent = false;
+ if ( curFileTime.
+ epicsTimeFromCu
+ ( curFileTime.
+ ET_TICKS_
+ firstMessageWasSent = false;
+ }
+ else {
+ /*
+ * if the system time jumps to before the EPICS epoch
+ * then latch to the EPICS epoch printing only one
+ * warning message the first time that the issue is
+ * detected
+ */
+ if ( ! firstMessageWasSent ) {
+ errlogPrintf (
+ "win32 osdTime.cpp time PLL update detected questionable "
+ "system date prior to EPICS epoch, epics time will not advance\n" );
+ firstMessageWasSent = true;
+ }
+ epicsTimeFromCu
+ }
+ }
delta = epicsTimeFromCu rrentFileTime - this->epicsTime Last; TICKS_PER_ SEC || delta < -EPICS_ TIME_TICKS_ PER_SEC ) {
if ( delta > EPICS_TIME_