From 6ae9e539a61c9d9fce28d70b9948f3fbeb8f142d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 8 Apr 2022 11:40:35 +0200 Subject: [PATCH] more useful printout --- bsp_q7s/core/CoreController.cpp | 7 +++++++ linux/devices/GPSHyperionLinuxController.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index f89230b3..42ba4307 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -16,6 +16,7 @@ #endif #include #include + #include #include @@ -1730,6 +1731,12 @@ ReturnValue_t CoreController::initClockFromTimeFile() { if (iss.bad() or *checkPtr) { return RETURN_FAILED; } +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = currentTime.tv_sec; + std::tm *time = std::gmtime(&timeRaw); + sif::info << "Setting system time from time files: " << std::put_time(time, "%c %Z") + << std::endl; +#endif return Clock::setClock(¤tTime); } return RETURN_OK; diff --git a/linux/devices/GPSHyperionLinuxController.cpp b/linux/devices/GPSHyperionLinuxController.cpp index 4dbb8f9c..0947e396 100644 --- a/linux/devices/GPSHyperionLinuxController.cpp +++ b/linux/devices/GPSHyperionLinuxController.cpp @@ -192,7 +192,12 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() { } if (timeInit and validFix) { if (not utility::timeSanityCheck()) { - sif::info << "Setting init clock in gps ctrl" << std::endl; +#if OBSW_VERBOSE_LEVEL >= 1 + time_t timeRaw = time.tv_sec; + std::tm *time = std::gmtime(&timeRaw); + sif::info << "Setting invalid system time from GPS data directly: " + << std::put_time(time, "%c %Z") << std::endl; +#endif // For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb.. Clock::setClock(&time); }