diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 39a09d5a..91881db5 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -52,8 +52,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU2Handler" << std::endl; @@ -68,8 +68,8 @@ ReturnValue_t PCDUHandler::initialize() { return returnvalue::FAILED; } result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage( - static_cast(P60System::SetIds::CORE), this->getObjectId(), - commandQueue->getId(), true); + static_cast(P60System::SetIds::CORE), this->getObjectId(), commandQueue->getId(), + true); if (result != returnvalue::OK) { sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " << "PDU1Handler" << std::endl; @@ -113,8 +113,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* if (sid == sid_t(objects::PDU2_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu2CoreHk, &timeStampPdu2HkDataset); updatePdu2SwitchStates(); - } else if (sid == - sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { + } else if (sid == sid_t(objects::PDU1_HANDLER, static_cast(P60System::SetIds::CORE))) { updateHkTableDataset(storeId, &pdu1CoreHk, &timeStampPdu1HkDataset); updatePdu1SwitchStates(); } else { diff --git a/mission/devices/PayloadPcduHandler.cpp b/mission/devices/PayloadPcduHandler.cpp index 56822bd5..d9e41c7f 100644 --- a/mission/devices/PayloadPcduHandler.cpp +++ b/mission/devices/PayloadPcduHandler.cpp @@ -33,6 +33,7 @@ void PayloadPcduHandler::doStartUp() { if (pwrStateMachine.getState() == power::States::IDLE) { pwrStateMachine.start(MODE_ON, pwrSubmode); } + clearSetOnOffFlag = true; auto opCode = pwrStateMachine.fsm(); if (opCode == power::OpCodes::TO_NOT_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { pwrStateMachine.reset(); @@ -50,6 +51,11 @@ void PayloadPcduHandler::doShutDown() { if (pwrStateMachine.getState() == power::States::IDLE) { pwrStateMachine.start(MODE_OFF, 0); } + if (clearSetOnOffFlag) { + std::memset(adcSet.processed.value, 0, adcSet.processed.getSerializedSize()); + clearSetOnOffFlag = false; + } + auto opCode = pwrStateMachine.fsm(); if (opCode == power::OpCodes::TO_OFF_DONE or opCode == power::OpCodes::TIMEOUT_OCCURED) { pwrStateMachine.reset(); diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index 6a9334ca..2f89c837 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -124,6 +124,7 @@ class PayloadPcduHandler : public DeviceHandlerBase { bool txToMpaInjectionRequested = false; bool mpaToHpaInjectionRequested = false; bool allOnInjectRequested = false; + bool clearSetOnOffFlag = true; PeriodicOperationDivider opDivider = PeriodicOperationDivider(5); uint8_t tempReadDivisor = 1; diff --git a/mission/devices/devicedefinitions/GomspaceDefinitions.h b/mission/devices/devicedefinitions/GomspaceDefinitions.h index 325a2a0c..d2ffdc25 100644 --- a/mission/devices/devicedefinitions/GomspaceDefinitions.h +++ b/mission/devices/devicedefinitions/GomspaceDefinitions.h @@ -102,11 +102,7 @@ namespace P60System { enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 }; -enum class SetIds : uint32_t { - CORE = 1, - AUX = 2, - CONFIG = 3 -}; +enum class SetIds : uint32_t { CORE = 1, AUX = 2, CONFIG = 3 }; } // namespace P60System diff --git a/tmtc b/tmtc index b2bab4c9..9493cdaa 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit b2bab4c964848d6f78a6f44525166dcf24cc46b6 +Subproject commit 9493cdaabf3cef636dcab2c98768215b0e58636b