From c67a9fa2c284131721c3aa8e9500473c76330d02 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 Oct 2023 17:10:37 +0200 Subject: [PATCH 1/2] this might be a bugfix --- CHANGELOG.md | 2 ++ mission/payload/PayloadPcduHandler.cpp | 13 +++++++++++-- mission/payload/PayloadPcduHandler.h | 2 ++ tmtc | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9308d71d..55857ce1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,8 @@ will consitute of a breaking change warranting a new major release: - PL Enable set of the power controller is now set to invalid properly if the power controller is not in normal mode. - MPSoC debug mode. +- Possible bugfix for PL PCDU parameter JSON handling which might not have been initialized + properly from the JSON file. # [v7.1.0] 2023-10-11 diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index bda15b20..48bc3b6a 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -395,7 +395,6 @@ void PayloadPcduHandler::quickTransitionBackToOff(bool startTransitionToOff, boo void PayloadPcduHandler::checkAdcValues() { using namespace plpcdu; - checkJsonFileInit(); adcSet.processed[U_BAT_DIV_6] = static_cast(adcSet.channels[0]) * VOLTAGE_DIV / MAX122X_BIT * MAX122X_VREF; adcSet.processed[U_NEG_V_FB] = @@ -529,6 +528,10 @@ void PayloadPcduHandler::checkJsonFileInit() { params.initialize(sdcMan->getCurrentMountPrefix()); jsonFileInitComplete = true; } + } else { + if (not sdcMan->isSdCardUsable(std::nullopt)) { + jsonFileInitComplete = false; + } } } @@ -564,6 +567,13 @@ bool PayloadPcduHandler::checkCurrent(float val, float upperBound, Event event) return true; } +ReturnValue_t PayloadPcduHandler::initialize() { + checkJsonFileInit(); + return DeviceHandlerBase::initialize(); +} + +void PayloadPcduHandler::performOperationHook() { checkJsonFileInit(); } + ReturnValue_t PayloadPcduHandler::checkModeCommand(Mode_t commandedMode, Submode_t commandedSubmode, uint32_t* msToReachTheMode) { if (commandedMode != MODE_OFF) { @@ -717,7 +727,6 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key, if (result != returnvalue::OK) { return result; } - params.setValue(key, newValue); // Do this so the dumping and loading with the framework works as well doubleDummy = newValue; parameterWrapper->set(doubleDummy); diff --git a/mission/payload/PayloadPcduHandler.h b/mission/payload/PayloadPcduHandler.h index a4574f53..d48d0f89 100644 --- a/mission/payload/PayloadPcduHandler.h +++ b/mission/payload/PayloadPcduHandler.h @@ -67,7 +67,9 @@ class PayloadPcduHandler : public DeviceHandlerBase { SdCardMountedIF* sdcMan, Stack5VHandler& stackHandler, bool periodicPrintout); void setToGoToNormalModeImmediately(bool enable); + void performOperationHook() override; void enablePeriodicPrintout(bool enable, uint8_t divider); + ReturnValue_t initialize() override; #ifdef XIPHOS_Q7S static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie, diff --git a/tmtc b/tmtc index 60f7ae54..70c3f9dc 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 60f7ae5453b387ee5ebcf6a338c34284004dbce7 +Subproject commit 70c3f9dcaaa8f0623ee8c30d639947ea36f9bac1 From 70747e1864ae48849308b1bcae0c1b097fb92f89 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 Oct 2023 17:28:20 +0200 Subject: [PATCH 2/2] bump PL PCDU handler --- mission/payload/PayloadPcduHandler.cpp | 1 + tmtc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mission/payload/PayloadPcduHandler.cpp b/mission/payload/PayloadPcduHandler.cpp index 48bc3b6a..b3b71aea 100644 --- a/mission/payload/PayloadPcduHandler.cpp +++ b/mission/payload/PayloadPcduHandler.cpp @@ -727,6 +727,7 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key, if (result != returnvalue::OK) { return result; } + params.setValue(key, newValue); // Do this so the dumping and loading with the framework works as well doubleDummy = newValue; parameterWrapper->set(doubleDummy); diff --git a/tmtc b/tmtc index 70c3f9dc..b45b0b22 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 70c3f9dcaaa8f0623ee8c30d639947ea36f9bac1 +Subproject commit b45b0b2271cd67d501921a97a1325fb983da4d00