VxWorks: Provide osdClockReport() for OS clock sync tasks.

This commit is contained in:
Andrew Johnson
2022-06-15 14:10:55 -05:00
committed by Michael Davidsaver
parent c71ebd1221
commit 1df973b234
3 changed files with 20 additions and 1 deletions
@@ -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
}
+4 -1
View File
@@ -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;
}