typos and other minor adaptions
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Robin Müller 2023-02-07 10:22:12 +01:00
parent 07ca738842
commit d6aa6875cc
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -199,19 +199,17 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
}
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 (newFixMode == 2 or newFixMode == 3) {
if (gps.fix.mode == 2 or gps.fix.mode == 3) {
validFix = true;
}
if (gpsSet.fixMode.value != newFixMode) {
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, newFixMode);
if (gpsSet.fixMode.value != gps.fix.mode) {
triggerEvent(GpsHyperion::GPS_FIX_CHANGE, gpsSet.fixMode.value, gps.fix.mode);
}
gpsSet.fixMode.value = newFixMode;
gpsSet.fixMode.value = gps.fix.mode;
if (gps.fix.mode == 0 or gps.fix.mode == 1) {
if (modeCommanded and maxTimeToReachFix.hasTimedOut()) {
// We are supposed to be on and functioning, but not fix was found
// We are supposed to be on and functioning, but no fix was found
if (mode == MODE_ON or mode == MODE_NORMAL) {
mode = MODE_OFF;
}
@ -260,6 +258,7 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
gpsSet.speed.setValid(false);
}
if (TIME_SET != (TIME_SET & gps.set)) {
timeval time = {};
#if LIBGPS_VERSION_MINOR <= 17
gpsSet.unixSeconds.value = std::floor(gps.fix.time);
@ -272,9 +271,9 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
time.tv_sec = gpsSet.unixSeconds.value;
// If the time is totally wrong (e.g. year 2000 after system reset because we do not have a RTC
// and no time file available) we set it with the roughly valid time from the GPS.
// NTP might only work if the time difference between sys time and current time is not too large.
// NTP might only work if the time difference between sys time and current time is not too
// large.
overwriteTimeIfNotSane(time, validFix);
Clock::TimeOfDay_t timeOfDay = {};
Clock::convertTimevalToTimeOfDay(&time, &timeOfDay);
gpsSet.year = timeOfDay.year;
@ -283,6 +282,16 @@ ReturnValue_t GpsHyperionLinuxController::handleGpsReadData() {
gpsSet.hours = timeOfDay.hour;
gpsSet.minutes = timeOfDay.minute;
gpsSet.seconds = timeOfDay.second;
} else {
gpsSet.unixSeconds.setValid(false);
gpsSet.year.setValid(false);
gpsSet.month.setValid(false);
gpsSet.day.setValid(false);
gpsSet.hours.setValid(false);
gpsSet.minutes.setValid(false);
gpsSet.seconds.setValid(false);
}
if (debugHyperionGps) {
sif::info << "-- Hyperion GPS Data --" << std::endl;
#if LIBGPS_VERSION_MINOR <= 17