only set time valid if at least 1 sat in view
Some checks are pending
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-03-21 12:54:14 +01:00
parent 2be5cdabb0
commit ab74382c12
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 5 additions and 1 deletions

View File

@ -28,6 +28,7 @@ will consitute of a breaking change warranting a new major release:
- Fixed transition for dual power lane assemblies: When going from dual side submode to single side - Fixed transition for dual power lane assemblies: When going from dual side submode to single side
submode, perform logical commanding first, similarly to when going to OFF mode. submode, perform logical commanding first, similarly to when going to OFF mode.
- GPS time is only set to valid if at least one satellite is in view.
## Changed ## Changed

View File

@ -302,7 +302,10 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
// TIME is set for every message, no need for a counter // TIME is set for every message, no need for a counter
bool timeValid = false; bool timeValid = false;
if (TIME_SET == (TIME_SET & gps.set)) { if (TIME_SET == (TIME_SET & gps.set)) {
timeValid = true; // To prevent totally incorrect times from being declared valid.
if(gpsSet.satInView.isValid() and gpsSet.satInView.value >= 1) {
timeValid = true;
}
timeval time = {}; timeval time = {};
#if LIBGPS_VERSION_MINOR <= 17 #if LIBGPS_VERSION_MINOR <= 17
gpsSet.unixSeconds.value = std::floor(gps.fix.time); gpsSet.unixSeconds.value = std::floor(gps.fix.time);