VxWorks: Provide osdClockReport() for OS clock sync tasks.
This commit is contained in:
committed by
Michael Davidsaver
parent
c71ebd1221
commit
1df973b234
@@ -120,6 +120,20 @@ void osdNTPReport(void)
|
||||
printf("NTP Server = %s\n", pserverAddr);
|
||||
}
|
||||
|
||||
void osdClockReport(void)
|
||||
{
|
||||
const char * ntpTask;
|
||||
|
||||
if (taskNameToId(sntp_sync_task) != ERROR)
|
||||
ntpTask = sntp_sync_task;
|
||||
else if (taskNameToId(ntp_daemon) != ERROR)
|
||||
ntpTask = ntp_daemon;
|
||||
else {
|
||||
printf("No VxWorks OS clock sync tasks are running\n");
|
||||
return;
|
||||
}
|
||||
printf("VxWorks OS clock sync task '%s' is running\n", ntpTask);
|
||||
}
|
||||
|
||||
// Other Time Routines
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@ extern "C" {
|
||||
void osdNTPInit(void);
|
||||
int osdNTPGet(struct timespec *);
|
||||
void osdNTPReport(void);
|
||||
void osdClockReport(void);
|
||||
|
||||
#define osdTickRateGet sysClkRateGet
|
||||
#define osdTickGet tickGet
|
||||
#define osdClockReport osdClockReport
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -292,7 +292,10 @@ int ClockTime_Report(int level)
|
||||
epicsTimeToStrftime(timebuf, sizeof(timebuf),
|
||||
"%Y-%m-%d %H:%M:%S.%06f", &ClockTimePvt.startTime);
|
||||
printf("Program started at %s\n", timebuf);
|
||||
printf("OS Clock synchronization thread not running.\n");
|
||||
printf("OS Clock synchronization thread is not running.\n");
|
||||
}
|
||||
#ifdef osdClockReport
|
||||
osdClockReport();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user