From d60291236449525d6b78f665b9687deed9a5619a Mon Sep 17 00:00:00 2001 From: "Jakob.Meier" Date: Mon, 8 Feb 2021 14:12:36 +0100 Subject: [PATCH] fixed PCDU memory leak --- fsfw | 2 +- fsfwconfig/OBSWConfig.h | 2 +- .../PollingSequenceFactory.cpp | 4 +++- mission/core/GenericFactory.cpp | 3 ++- mission/devices/GomspaceDeviceHandler.cpp | 2 +- mission/devices/PCDUHandler.cpp | 24 +++++++++---------- 6 files changed, 20 insertions(+), 17 deletions(-) diff --git a/fsfw b/fsfw index 7d0916a4..e994d81e 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 7d0916a44e18c87b00998448333023186b3d85b1 +Subproject commit e994d81e1862fade52b090311b3978fb59061966 diff --git a/fsfwconfig/OBSWConfig.h b/fsfwconfig/OBSWConfig.h index a26ea317..954931d8 100644 --- a/fsfwconfig/OBSWConfig.h +++ b/fsfwconfig/OBSWConfig.h @@ -15,7 +15,7 @@ #define TE0720 0 #define PDU2_DEBUG 0 -#define PDU1_DEBUG 1 +#define PDU1_DEBUG 0 #include "OBSWVersion.h" diff --git a/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp b/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp index 089c0ed4..ba6706cf 100644 --- a/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp +++ b/fsfwconfig/pollingsequence/PollingSequenceFactory.cpp @@ -14,7 +14,6 @@ ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::TMP1075_HANDLER_2, length * 0, DeviceHandlerIF::PERFORM_OPERATION); - thisSequence->addSlot(objects::PCDU_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::HEATER_HANDLER, length * 0, DeviceHandlerIF::PERFORM_OPERATION); thisSequence->addSlot(objects::TMP1075_HANDLER_1, length * 0.2, DeviceHandlerIF::SEND_WRITE); @@ -42,6 +41,9 @@ ReturnValue_t pst::gomspacePstInit(FixedTimeslotTaskIF *thisSequence){ uint32_t length = thisSequence->getPeriodMs(); + 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, diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index b3866cb0..0b50a45d 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -49,7 +49,8 @@ void ObjectFactory::produceGenericObjects() { { PoolManager::LocalPoolConfig poolCfg = { - {100, 16}, {50, 32}, {25, 64}, {15, 128}, {5, 1024} + { 100, 16 }, { 100, 32 }, { 100, 64 }, + { 100, 128 }, { 50, 256 }, { 50, 512 }, { 50, 1024 }, { 10, 2048 } }; new PoolManager(objects::IPC_STORE, poolCfg); } diff --git a/mission/devices/GomspaceDeviceHandler.cpp b/mission/devices/GomspaceDeviceHandler.cpp index e223aaca..f02548c2 100644 --- a/mission/devices/GomspaceDeviceHandler.cpp +++ b/mission/devices/GomspaceDeviceHandler.cpp @@ -4,7 +4,7 @@ GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress, uint16_t hkTableReplySize, LocalPoolDataSetBase* hkTableDataset) : - DeviceHandlerBase(objectId, comIF, comCookie, nullptr, 60), maxConfigTableAddress(maxConfigTableAddress), + DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress), maxHkTableAddress(maxHkTableAddress), hkTableReplySize(hkTableReplySize), hkTableDataset(hkTableDataset) { mode = MODE_NORMAL; if (comCookie == NULL) { diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 6b1261c9..f441cf3d 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -55,18 +55,18 @@ ReturnValue_t PCDUHandler::initialize() { } /* Subscribing for housekeeping table update messages of the PDU1 */ -// HasLocalDataPoolIF* pdu1Handler = objectManager->get(objects::PDU1_HANDLER); -// if(pdu1Handler == nullptr) { -// sif::error << "PCDUHandler::initialize: Invalid pdu1Handler" << std::endl; -// return RETURN_FAILED; -// } -// result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessages( -// PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true); -// if (result != RETURN_OK) { -// sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " -// << "PDU1Handler" << std::endl; -// return result; -// } + HasLocalDataPoolIF* pdu1Handler = objectManager->get(objects::PDU1_HANDLER); + if(pdu1Handler == nullptr) { + sif::error << "PCDUHandler::initialize: Invalid pdu1Handler" << std::endl; + return RETURN_FAILED; + } + result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessages( + PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true); + if (result != RETURN_OK) { + sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from " + << "PDU1Handler" << std::endl; + return result; + } return RETURN_OK; }