From 3c869e521505a11aae2bc9215c7568f77ecf8228 Mon Sep 17 00:00:00 2001 From: meggert Date: Wed, 13 Mar 2024 16:08:21 +0100 Subject: [PATCH] idk what i am doing here --- linux/acs/GpsHyperionLinuxController.cpp | 20 +++++++++++++++++++- mission/acs/archive/GPSDefinitions.h | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/linux/acs/GpsHyperionLinuxController.cpp b/linux/acs/GpsHyperionLinuxController.cpp index c108a828..a9381ce4 100644 --- a/linux/acs/GpsHyperionLinuxController.cpp +++ b/linux/acs/GpsHyperionLinuxController.cpp @@ -254,9 +254,27 @@ ReturnValue_t GpsHyperionLinuxController::handleCoreTelemetry(bool modeIsSet) { } newFix = gps.fix.mode; if (newFix == GpsHyperion::FixMode::NOT_SEEN or newFix == GpsHyperion::FixMode::NO_FIX) { - if (modeCommanded and maxTimeToReachFix.hasTimedOut()) { + if (maxTimeToReachFix.hasTimedOut()) { // We are supposed to be on and functioning, but no fix was found // ToDo:: maybe pull reset pins here + if (resetCallback != nullptr) { + PoolReadGuard pg(&gpsSet); + // Set HK entries invalid + gpsSet.setValidity(false, true); + ReturnValue_t result = resetCallback(0, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + return result; + } + } + if (resetCallback != nullptr) { + PoolReadGuard pg(&gpsSet); + // Set HK entries invalid + gpsSet.setValidity(false, true); + ReturnValue_t result = resetCallback(1, 1, resetCallbackArgs); + if (result != returnvalue::OK) { + return result; + } + } } } } diff --git a/mission/acs/archive/GPSDefinitions.h b/mission/acs/archive/GPSDefinitions.h index 8feb46a7..0f597397 100644 --- a/mission/acs/archive/GPSDefinitions.h +++ b/mission/acs/archive/GPSDefinitions.h @@ -15,7 +15,7 @@ static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::GPS_HANDLER; static constexpr Event GPS_FIX_CHANGE = event::makeEvent(SUBSYSTEM_ID, 0, severity::INFO); //! [EXPORT] : [COMMENT] Could not get fix in maximum allowed time. P1: Maximum allowed time //! to get a fix after the GPS was switched on. -static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::LOW); +static constexpr Event CANT_GET_FIX = event::makeEvent(SUBSYSTEM_ID, 1, severity::MEDIUM); static constexpr DeviceCommandId_t GPS_REPLY = 0; static constexpr DeviceCommandId_t TRIGGER_RESET_PIN_GNSS = 5;