diff --git a/fsfw b/fsfw index e949368b..cec12c00 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e949368b062e8703c35d2043ece8d7258cd2608b +Subproject commit cec12c007336441ea0f5ce912c181c3f14e574ca diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index 0f9232e0..942404d3 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -514,7 +514,6 @@ ReturnValue_t pst::pstGompaceCan(FixedTimeslotTaskIF *thisSequence) { #if Q7S_EM != 1 // PCDU handlers receives two messages and both must be handled thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::P60DOCK_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::PDU1_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index bc302bac..10d12cf8 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -81,27 +81,34 @@ ReturnValue_t PCDUHandler::initialize() { void PCDUHandler::initializeSwitchStates() { using namespace pcdu; - for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { - if (idx < PDU::CHANNELS_LEN) { - switchStates[idx] = INIT_SWITCHES_PDU1[idx]; - } else { - switchStates[idx] = INIT_SWITCHES_PDU2[idx]; + try { + for (uint8_t idx = 0; idx < NUMBER_OF_SWITCHES; idx++) { + if (idx < PDU::CHANNELS_LEN) { + switchStates[idx] = INIT_SWITCHES_PDU1.at(idx); + } else { + switchStates[idx] = INIT_SWITCHES_PDU2.at(idx - PDU::CHANNELS_LEN); + } } + } catch (const std::out_of_range& err) { + sif::error << "PCDUHandler::initializeSwitchStates: " << err.what() << std::endl; } } void PCDUHandler::readCommandQueue() { - ReturnValue_t result; + ReturnValue_t result = RETURN_OK; CommandMessage command; - result = commandQueue->receiveMessage(&command); - if (result != RETURN_OK) { - return; - } + for (result = commandQueue->receiveMessage(&command); result == RETURN_OK; + result = commandQueue->receiveMessage(&command)) { + result = commandQueue->receiveMessage(&command); + if (result != RETURN_OK) { + return; + } - result = poolManager.handleHousekeepingMessage(&command); - if (result == RETURN_OK) { - return; + result = poolManager.handleHousekeepingMessage(&command); + if (result == RETURN_OK) { + return; + } } }