From fe80ff4070828f1ecc42665f757db99f597e9de7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 23 Jan 2023 11:52:46 +0100 Subject: [PATCH] move some config and tweak queue sizes --- bsp_q7s/core/ObjectFactory.cpp | 9 +++++---- common/config/commonConfig.h.in | 8 -------- common/config/eive/definitions.h | 7 +++++++ linux/ipcore/PdecHandler.h | 3 ++- linux/ipcore/Ptme.cpp | 3 ++- mission/core/GenericFactory.cpp | 2 +- mission/tmtc/CcsdsIpCoreHandler.cpp | 5 +++-- mission/tmtc/CcsdsIpCoreHandler.h | 4 +++- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index ade1cb4a..e8c02ab1 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -140,6 +140,7 @@ void ObjectFactory::createTmpComponents() { auto* tmpDevHandler = new Tmp1075Handler(tmpDevIds[idx].first, objects::I2C_COM_IF, tmpDevCookies[idx]); tmpDevHandler->connectModeTreeParent(satsystem::tcs::SUBSYSTEM); + // TODO: Remove this after TCS subsystem was added // These devices are connected to the 3V3 stack and should be powered permanently. Therefore, // we set them to normal mode immediately here. tmpDevHandler->setModeNormal(); @@ -789,13 +790,13 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF, objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT); VirtualChannel* vc = nullptr; - vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); + vc = new VirtualChannel(ccsds::VC0, config::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER); (*ipCoreHandler)->addVirtualChannel(ccsds::VC0, vc); - vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER); + vc = new VirtualChannel(ccsds::VC1, config::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER); (*ipCoreHandler)->addVirtualChannel(ccsds::VC1, vc); - vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER); + vc = new VirtualChannel(ccsds::VC2, config::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER); (*ipCoreHandler)->addVirtualChannel(ccsds::VC2, vc); - vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER); + vc = new VirtualChannel(ccsds::VC3, config::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER); (*ipCoreHandler)->addVirtualChannel(ccsds::VC3, vc); GpioCookie* gpioCookiePdec = new GpioCookie; diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index effa9c4f..a6b7faab 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -36,14 +36,6 @@ extern const fsfw::Version OBSW_VERSION; extern const uint16_t PUS_PACKET_ID; extern const uint16_t CFDP_PACKET_ID; - -static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; -static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; -static constexpr uint8_t VC0_QUEUE_SIZE = 50; -static constexpr uint8_t VC1_QUEUE_SIZE = 50; -static constexpr uint8_t VC2_QUEUE_SIZE = 50; -static constexpr uint8_t VC3_QUEUE_SIZE = 50; - } #endif /* COMMON_CONFIG_COMMONCONFIG_H_ */ diff --git a/common/config/eive/definitions.h b/common/config/eive/definitions.h index 1bf2fc77..2ed925d9 100644 --- a/common/config/eive/definitions.h +++ b/common/config/eive/definitions.h @@ -43,6 +43,13 @@ static constexpr uint32_t LEGACY_SA_DEPL_CHANNEL_ALTERNATION_INTERVAL_SECS = 5; // Maximum allowed burn time allowed by the software. static constexpr uint32_t SA_DEPL_MAX_BURN_TIME = 180; +static constexpr uint32_t CCSDS_HANDLER_QUEUE_SIZE = 50; +static constexpr uint8_t NUMBER_OF_VIRTUAL_CHANNELS = 4; +static constexpr uint8_t VC0_QUEUE_SIZE = 80; +static constexpr uint8_t VC1_QUEUE_SIZE = 80; +static constexpr uint8_t VC2_QUEUE_SIZE = 50; +static constexpr uint8_t VC3_QUEUE_SIZE = 50; + } // namespace config #endif /* COMMON_CONFIG_DEFINITIONS_H_ */ diff --git a/linux/ipcore/PdecHandler.h b/linux/ipcore/PdecHandler.h index b7089999..6ebd9ce6 100644 --- a/linux/ipcore/PdecHandler.h +++ b/linux/ipcore/PdecHandler.h @@ -5,6 +5,7 @@ #include "OBSWConfig.h" #include "PdecConfig.h" +#include "eive/definitions.h" #include "fsfw/action/ActionHelper.h" #include "fsfw/action/HasActionsIF.h" #include "fsfw/objectmanager/SystemObject.h" @@ -120,7 +121,7 @@ class PdecHandler : public SystemObject, public ExecutableObjectIF, public HasAc //! Invalid BC control command static const ReturnValue_t INVALID_BC_CC = MAKE_RETURN_CODE(0xAE); - static const uint32_t QUEUE_SIZE = common::CCSDS_HANDLER_QUEUE_SIZE; + static const uint32_t QUEUE_SIZE = config::CCSDS_HANDLER_QUEUE_SIZE; // Action IDs static const ActionId_t PRINT_CLCW = 0; diff --git a/linux/ipcore/Ptme.cpp b/linux/ipcore/Ptme.cpp index 0c475236..50b1a37c 100644 --- a/linux/ipcore/Ptme.cpp +++ b/linux/ipcore/Ptme.cpp @@ -4,6 +4,7 @@ #include #include "PtmeConfig.h" +#include "eive/definitions.h" #include "fsfw/serviceinterface/ServiceInterface.h" Ptme::Ptme(object_id_t objectId) : SystemObject(objectId) {} @@ -32,7 +33,7 @@ ReturnValue_t Ptme::writeToVc(uint8_t vcId, const uint8_t* data, size_t size) { } void Ptme::addVcInterface(VcId_t vcId, VcInterfaceIF* vc) { - if (vcId > common::NUMBER_OF_VIRTUAL_CHANNELS) { + if (vcId > config::NUMBER_OF_VIRTUAL_CHANNELS) { sif::warning << "Ptme::addVcInterface: Invalid virtual channel ID" << std::endl; return; } diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index cca48baf..b0537a7b 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -122,7 +122,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_, PusTmFun new PusDistributor(config::EIVE_PUS_APID, objects::PUS_PACKET_DISTRIBUTOR, ccsdsDistrib); *cfdpFunnel = new CfdpTmFunnel(objects::CFDP_TM_FUNNEL, config::EIVE_CFDP_APID, *tmStore, 50); - *pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, 80); + *pusFunnel = new PusTmFunnel(objects::PUS_TM_FUNNEL, *timeStamper, *tmStore, 100); #if OBSW_ADD_TCPIP_SERVERS == 1 #if OBSW_ADD_TMTC_UDP_SERVER == 1 (*cfdpFunnel)->addDestination(*udpBridge, 0); diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index c65a12a8..350c327f 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -3,6 +3,7 @@ #include #include +#include "eive/definitions.h" #include "fsfw/events/EventManagerIF.h" #include "fsfw/ipc/QueueFactory.h" #include "fsfw/objectmanager/ObjectManager.h" @@ -161,7 +162,7 @@ void CcsdsIpCoreHandler::readCommandQueue(void) { MessageQueueId_t CcsdsIpCoreHandler::getCommandQueue() const { return commandQueue->getId(); } void CcsdsIpCoreHandler::addVirtualChannel(VcId_t vcId, VirtualChannel* virtualChannel) { - if (vcId > common::NUMBER_OF_VIRTUAL_CHANNELS) { + if (vcId > config::NUMBER_OF_VIRTUAL_CHANNELS) { sif::warning << "CcsdsHandler::addVirtualChannel: Invalid virtual channel ID" << std::endl; return; } @@ -182,7 +183,7 @@ void CcsdsIpCoreHandler::addVirtualChannel(VcId_t vcId, VirtualChannel* virtualC } MessageQueueId_t CcsdsIpCoreHandler::getReportReceptionQueue(uint8_t virtualChannel) const { - if (virtualChannel < common::NUMBER_OF_VIRTUAL_CHANNELS) { + if (virtualChannel < config::NUMBER_OF_VIRTUAL_CHANNELS) { auto iter = virtualChannelMap.find(virtualChannel); if (iter != virtualChannelMap.end()) { return iter->second->getReportReceptionQueue(); diff --git a/mission/tmtc/CcsdsIpCoreHandler.h b/mission/tmtc/CcsdsIpCoreHandler.h index 942b73cb..9161064b 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.h +++ b/mission/tmtc/CcsdsIpCoreHandler.h @@ -1,10 +1,12 @@ #ifndef CCSDSHANDLER_H_ #define CCSDSHANDLER_H_ +#include #include #include "OBSWConfig.h" #include "VirtualChannel.h" +#include "eive/definitions.h" #include "fsfw/action/ActionHelper.h" #include "fsfw/action/HasActionsIF.h" #include "fsfw/events/EventMessage.h" @@ -83,7 +85,7 @@ class CcsdsIpCoreHandler : public SystemObject, static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER; static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER; - static const uint32_t QUEUE_SIZE = common::CCSDS_HANDLER_QUEUE_SIZE; + static const uint32_t QUEUE_SIZE = config::CCSDS_HANDLER_QUEUE_SIZE; static const ActionId_t SET_LOW_RATE = 0; static const ActionId_t SET_HIGH_RATE = 1;