store time file with lower frequency
This commit is contained in:
@ -1693,14 +1693,22 @@ void CoreController::setRebootMechanismLock(bool lock, xsc::Chip tgtChip, xsc::C
|
||||
|
||||
ReturnValue_t CoreController::timeFileHandler() {
|
||||
if (gpsFix == GpsHyperion::FixMode::FIX_2D or gpsFix == GpsHyperion::FixMode::FIX_3D) {
|
||||
// It is assumed that the system time is set from the GPS time
|
||||
timeval currentTime = {};
|
||||
ReturnValue_t result = Clock::getClock_timeval(¤tTime);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
if(opDivider.check()) {
|
||||
// It is assumed that the system time is set from the GPS time
|
||||
timeval currentTime = {};
|
||||
ReturnValue_t result = Clock::getClock_timeval(¤tTime);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
std::string fileName = currMntPrefix + TIME_FILE;
|
||||
std::ofstream timeFile(fileName);
|
||||
if (not timeFile.good()) {
|
||||
sif::error << "CoreController::timeFileHandler: Error opening time file: " <<
|
||||
strerror(errno) << std::endl;
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
|
||||
}
|
||||
std::ofstream timeFile(currMntPrefix + TIME_FILE);
|
||||
timeFile << "UNIX SECONDS: " << currentTime.tv_sec << std::endl;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user