diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 432befff..1f6fdec6 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -79,7 +79,6 @@ CoreController::CoreController(object_id_t objectId, bool enableHkSet) } catch (const std::filesystem::filesystem_error &e) { sif::error << "CoreController::CoreController: Failed with exception " << e.what() << std::endl; } - initLeapSeconds(); // Add script folder to path char *currentEnvPath = getenv("PATH"); std::string updatedEnvPath = std::string(currentEnvPath) + ":/home/root/scripts:/usr/local/bin"; @@ -1422,6 +1421,9 @@ void CoreController::performMountedSdCardOperations() { if (not timeFileInitDone) { initClockFromTimeFile(); } + if (not leapSecondsInitDone) { + initLeapSeconds(); + } performRebootWatchdogHandling(false); performRebootCountersHandling(false); } @@ -2083,6 +2085,7 @@ void CoreController::initLeapSeconds() { Clock::setLeapSeconds(config::LEAP_SECONDS); writeLeapSecondsToFile(config::LEAP_SECONDS); } + leapSecondsInitDone = true; } ReturnValue_t CoreController::initLeapSecondsFromFile() { diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h index 4864a2ec..1b1f9853 100644 --- a/bsp_q7s/core/CoreController.h +++ b/bsp_q7s/core/CoreController.h @@ -298,6 +298,7 @@ class CoreController : public ExtendedControllerBase, public ReceivesParameterMe std::string currMntPrefix; bool timeFileInitDone = false; + bool leapSecondsInitDone = false; bool performOneShotSdCardOpsSwitch = false; uint8_t shortSdCardCdCounter = 0; #if OBSW_THREAD_TRACING == 1