only set time every 60 seconds
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-03-29 17:47:40 +02:00
parent a8457d7966
commit 9cfb2bad51
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 17 additions and 13 deletions

View File

@ -16,7 +16,9 @@ GPSHyperionLinuxController::GPSHyperionLinuxController(object_id_t objectId, obj
: ExtendedControllerBase(objectId, objects::NO_OBJECT),
gpsSet(this),
myGpsmm(GPSD_SHARED_MEMORY, nullptr),
debugHyperionGps(debugHyperionGps) {}
debugHyperionGps(debugHyperionGps) {
timeUpdateCd.resetTimer();
}
GPSHyperionLinuxController::~GPSHyperionLinuxController() {}
@ -180,10 +182,11 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
timeIsConstantCounter = 0;
}
// If the received time does not change anymore for whatever reason, do not set it here
// to avoid stale times
if(timeIsConstantCounter < 3) {
// to avoid stale times. Also, don't do it too often often to avoid jumping times
if (timeIsConstantCounter < 3 and timeUpdateCd.hasTimedOut()) {
// Update the system time here for now. NTP seems to be unable to do so for whatever reason
settimeofday(&time, nullptr);
timeUpdateCd.resetTimer();
}
Clock::TimeOfDay_t timeOfDay = {};

View File

@ -52,6 +52,7 @@ class GPSHyperionLinuxController : public ExtendedControllerBase {
gpsmm myGpsmm;
bool debugHyperionGps = false;
uint32_t timeIsConstantCounter = 0;
Countdown timeUpdateCd = Countdown(60);
void readGpsDataFromGpsd();
};

View File

@ -339,9 +339,7 @@ gpioId_t HeaterHandler::getGpioIdFromSwitchNr(int switchNr) {
MessageQueueId_t HeaterHandler::getCommandQueue() const { return commandQueue->getId(); }
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) {
return RETURN_OK;
}
ReturnValue_t HeaterHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t HeaterHandler::getSwitchState(uint8_t switchNr) const { return 0; }

View File

@ -350,9 +350,7 @@ ReturnValue_t PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onO
return RETURN_OK;
}
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) {
return RETURN_OK;
}
ReturnValue_t PCDUHandler::sendFuseOnCommand(uint8_t fuseNr) { return RETURN_OK; }
ReturnValue_t PCDUHandler::getSwitchState(uint8_t switchNr) const {
if (switchNr >= pcduSwitches::NUMBER_OF_SWITCHES) {

View File

@ -145,13 +145,15 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
if (gpioIF->pullHigh(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
"of GNSS 0 high (used GNSS)" << std::endl;
"of GNSS 0 high (used GNSS)"
<< std::endl;
#endif
}
if (gpioIF->pullLow(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
"of GNSS 1 low (unused GNSS)" << std::endl;
"of GNSS 1 low (unused GNSS)"
<< std::endl;
#endif
}
if (gpioIF->pullLow(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) {
@ -180,13 +182,15 @@ ReturnValue_t AcsBoardAssembly::handleNormalOrOnModeCmd(Mode_t mode, Submode_t s
if (gpioIF->pullHigh(gpioIds::GNSS_1_NRESET) != HasReturnvaluesIF::RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
"of GNSS 1 high (used GNSS)" << std::endl;
"of GNSS 1 high (used GNSS)"
<< std::endl;
#endif
}
if (gpioIF->pullLow(gpioIds::GNSS_0_NRESET) != HasReturnvaluesIF::RETURN_OK) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::error << "AcsBoardAssembly::handleNormalOrOnModeCmd: Could not pull nReset pin"
"of GNSS 0 low (unused GNSS)" << std::endl;
"of GNSS 0 low (unused GNSS)"
<< std::endl;
#endif
}
if (gpioIF->pullHigh(gpioIds::GNSS_SELECT) != HasReturnvaluesIF::RETURN_OK) {