From 9e93f1c81402ec9b738021473dfb804b0d3985f1 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 27 May 2022 13:44:40 +0200 Subject: [PATCH 1/2] adaptions for EM --- bsp_q7s/OBSWConfig.h.in | 3 +++ bsp_q7s/core/InitMission.cpp | 6 +++++- bsp_q7s/core/ObjectFactory.cpp | 8 ++++++-- bsp_q7s/em/emObjectFactory.cpp | 6 +++++- fsfw | 2 +- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index ed321f8c..f5348031 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -10,6 +10,9 @@ #include "q7sConfig.h" #include "OBSWVersion.h" +// Set to 1 when software is build for EM +#define EM 0 + /*******************************************************************/ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index d824bb95..52ecd30f 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -155,6 +155,7 @@ void initmission::initTasks() { } #endif +#if OBSW_ADD_RTD_DEVICES == 1 PeriodicTaskIF* tcsPollingTask = factory->createPeriodicTask( "TCS_POLLING_TASK", 70, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.5, missedDeadlineFunc); result = tcsPollingTask->addComponent(objects::SPI_RTD_COM_IF); @@ -181,7 +182,6 @@ void initmission::initTasks() { objects::RTD_14_IC17_TCS_BOARD, objects::RTD_15_IC18_IMTQ, }; -#if OBSW_ADD_RTD_DEVICES == 1 tcsTask->addComponent(objects::TCS_BOARD_ASS); for (const auto& rtd : rtdIds) { tcsTask->addComponent(rtd, DeviceHandlerIF::PERFORM_OPERATION); @@ -287,10 +287,14 @@ void initmission::initTasks() { strHelperTask->startTask(); #endif /* OBSW_ADD_STAR_TRACKER == 1 */ +#if OBSW_ADD_ACS_HANDLERS == 1 acsTask->startTask(); +#endif /* OBSW_ADD_ACS_HANDLERS == 1 */ sysTask->startTask(); +#if OBSW_ADD_RTD_DEVICES == 1 tcsPollingTask->startTask(); tcsTask->startTask(); +#endif /* OBSW_ADD_RTD_DEVICES == 1 */ #if OBSW_ADD_PLOC_SUPERVISOR == 1 supvHelperTask->startTask(); #endif /* OBSW_ADD_PLOC_SUPERVISOR == 1 */ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index b5b5f06d..8cf872d3 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -102,9 +102,13 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; +#if EM == 1 + DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; +#else DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; - // DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; -#if OBSW_TM_TO_PTME == 1 +#endif /* EM == 1 */ + + #if OBSW_TM_TO_PTME == 1 TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; #else TmFunnel::downlinkDestination = objects::TMTC_BRIDGE; diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index 327e7b87..ad1fc458 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -38,9 +38,13 @@ void ObjectFactory::produce(void* args) { createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 +#if EM == 1 + createSyrlinksComponents(nullptr); +#else createSyrlinksComponents(pwrSwitcher); +#endif /* EM == 1 */ #endif /* OBSW_ADD_SYRLINKS == 1 */ - createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher); + createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); createPayloadComponents(gpioComIF); #if OBSW_ADD_MGT == 1 diff --git a/fsfw b/fsfw index ebbe0863..95a64e1d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit ebbe08639caae43667829d2cc2bcbdf91260e175 +Subproject commit 95a64e1da3bb6d334c58c9ba78747bcdaccd5a8b From 8106722a08315ca37197c13b1fd7c2e9e17da19a Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 27 May 2022 16:24:41 +0200 Subject: [PATCH 2/2] replaced EM preprocessor define --- bsp_q7s/OBSWConfig.h.in | 3 --- bsp_q7s/core/ObjectFactory.cpp | 4 ++-- bsp_q7s/em/emObjectFactory.cpp | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index f5348031..ed321f8c 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -10,9 +10,6 @@ #include "q7sConfig.h" #include "OBSWVersion.h" -// Set to 1 when software is build for EM -#define EM 0 - /*******************************************************************/ /** All of the following flags should be enabled for mission code */ /*******************************************************************/ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 8cf872d3..dbef1841 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -102,11 +102,11 @@ void Factory::setStaticFrameworkObjectIds() { CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR; CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL; -#if EM == 1 +#if OBSW_Q7S_EM == 1 DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT; #else DeviceHandlerBase::powerSwitcherId = objects::PCDU_HANDLER; -#endif /* EM == 1 */ +#endif /* OBSW_Q7S_EM == 1 */ #if OBSW_TM_TO_PTME == 1 TmFunnel::downlinkDestination = objects::CCSDS_HANDLER; diff --git a/bsp_q7s/em/emObjectFactory.cpp b/bsp_q7s/em/emObjectFactory.cpp index ad1fc458..9301f6d3 100644 --- a/bsp_q7s/em/emObjectFactory.cpp +++ b/bsp_q7s/em/emObjectFactory.cpp @@ -38,11 +38,11 @@ void ObjectFactory::produce(void* args) { createSolarArrayDeploymentComponents(); createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher); #if OBSW_ADD_SYRLINKS == 1 -#if EM == 1 +#if OBSW_Q7S_EM == 1 createSyrlinksComponents(nullptr); #else createSyrlinksComponents(pwrSwitcher); -#endif /* EM == 1 */ +#endif /* OBSW_Q7S_EM == 1 */ #endif /* OBSW_ADD_SYRLINKS == 1 */ createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF); createPayloadComponents(gpioComIF);