bugfixes and improvements
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

- Tests finished
This commit is contained in:
2022-04-08 11:22:16 +02:00
parent 45007d726d
commit 4a6840f098
12 changed files with 144 additions and 118 deletions

View File

@ -3,7 +3,7 @@
#include "OBSWConfig.h"
#include "fsfw/datapool/PoolReadGuard.h"
#include "fsfw/timemanager/Clock.h"
#include "linux/utility/utility.h"
#include "mission/utility/compileTime.h"
#if FSFW_DEV_HYPERION_GPS_CREATE_NMEA_CSV == 1
@ -127,9 +127,14 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
return;
}
bool validFix = false;
static_cast<void>(validFix);
// 0: Not seen, 1: No fix, 2: 2D-Fix, 3: 3D-Fix
int newFixMode = gps->fix.mode;
if(gpsSet.fixMode.value != newFixMode) {
if (newFixMode == 2 or newFixMode == 3) {
validFix = true;
}
if (gpsSet.fixMode.value != newFixMode) {
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode);
}
gpsSet.fixMode.value = newFixMode;
@ -185,11 +190,19 @@ void GPSHyperionLinuxController::readGpsDataFromGpsd() {
} else {
timeIsConstantCounter = 0;
}
if (timeInit) {
if (not utility::timeSanityCheck()) {
sif::info << "Setting init clock in gps ctrl" << std::endl;
// For some reason, the clock needs to be somewhat correct for NTP to work. Really dumb..
Clock::setClock(&time);
}
timeInit = false;
}
// If the received time does not change anymore for whatever reason, do not set it here
// to avoid stale times. Also, don't do it too often often to avoid jumping times
if (timeIsConstantCounter < 20 and timeUpdateCd.hasTimedOut()) {
// Update the system time here for now. NTP seems to be unable to do so for whatever reason.
// Further tests have shown that the time seems to be set by NTPD after sme time..
// Further tests have shown that the time seems to be set by NTPD after some time..
// Clock::setClock(&time);
timeUpdateCd.resetTimer();
}