From ac0326a944fb36133f1cde5a0f724983de0af1fb Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 26 Mar 2022 13:54:05 +0100 Subject: [PATCH] various improvements --- CMakeLists.txt | 5 ++++ bsp_q7s/core/ObjectFactory.cpp | 8 +++++- bsp_q7s/devices/PlocUpdater.h | 1 + bsp_q7s/memory/FileSystemHandler.h | 1 + common/config/{ => eive}/definitions.h | 7 +++++ linux/fsfwconfig/OBSWConfig.h.in | 38 ++++++-------------------- mission/core/GenericFactory.cpp | 2 +- mission/tmtc/CCSDSHandler.cpp | 5 ++-- mission/tmtc/CCSDSHandler.h | 11 +++----- 9 files changed, 38 insertions(+), 40 deletions(-) rename common/config/{ => eive}/definitions.h (55%) diff --git a/CMakeLists.txt b/CMakeLists.txt index b959b5a7..1d468c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,6 +20,9 @@ option(EIVE_ADD_JSON_LIB "Add JSON library" ON) option(EIVE_SYSROOT_MAGIC "Perform sysroot magic which might not be necessary" OFF) option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON) +set(OBSW_ADD_STAR_TRACKER 0) +set(OBSW_DEBUG_STARTRACKER 0) + if(NOT FSFW_OSAL) set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.") endif() @@ -117,6 +120,8 @@ if(TGT_BSP) # Used by configure file set(EGSE ON) set(FSFW_HAL_LINUX_ADD_LIBGPIOD OFF) + set(OBSW_ADD_STAR_TRACKER 1) + set(OBSW_DEBUG_STARTRACKER 1) endif() if(TGT_BSP MATCHES "arm/beagleboneblack") diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 95b149ac..4c8ec3fc 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1087,9 +1087,15 @@ void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) { AxiPtmeConfig* axiPtmeConfig = new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG); PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig); +#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1 + // Set to high value when not sending via syrlinks + static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day +#else + static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes +#endif CCSDSHandler* ccsdsHandler = new CCSDSHandler( objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, - gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA); + 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); diff --git a/bsp_q7s/devices/PlocUpdater.h b/bsp_q7s/devices/PlocUpdater.h index bfd86995..ad6e46fa 100644 --- a/bsp_q7s/devices/PlocUpdater.h +++ b/bsp_q7s/devices/PlocUpdater.h @@ -4,6 +4,7 @@ #include "OBSWConfig.h" #include "bsp_q7s/memory/SdCardManager.h" #include "devicedefinitions/PlocSupervisorDefinitions.h" +#include "eive/definitions.h" #include "fsfw/action/ActionHelper.h" #include "fsfw/action/CommandActionHelper.h" #include "fsfw/action/CommandsActionsIF.h" diff --git a/bsp_q7s/memory/FileSystemHandler.h b/bsp_q7s/memory/FileSystemHandler.h index 6973c3c8..282cddba 100644 --- a/bsp_q7s/memory/FileSystemHandler.h +++ b/bsp_q7s/memory/FileSystemHandler.h @@ -6,6 +6,7 @@ #include "OBSWConfig.h" #include "SdCardManager.h" +#include "eive/definitions.h" #include "fsfw/ipc/MessageQueueIF.h" #include "fsfw/memory/HasFileSystemIF.h" #include "fsfw/objectmanager/SystemObject.h" diff --git a/common/config/definitions.h b/common/config/eive/definitions.h similarity index 55% rename from common/config/definitions.h rename to common/config/eive/definitions.h index fbb71648..a7316ad9 100644 --- a/common/config/definitions.h +++ b/common/config/eive/definitions.h @@ -8,6 +8,13 @@ namespace config { static constexpr uint32_t PL_PCDU_TRANSITION_TIMEOUT_MS = 20 * 60 * 1000; static constexpr uint32_t LONGEST_MODE_TIMEOUT_SECONDS = PL_PCDU_TRANSITION_TIMEOUT_MS / 1000; +/* Add mission configuration flags here */ +static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50; +static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50; +static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50; + +static constexpr uint8_t LIVE_TM = 0; + } diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 9e3a8441..6266742c 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -11,11 +11,6 @@ #cmakedefine BEAGLEBONEBLACK #cmakedefine EGSE -#ifdef RASPBERRY_PI -#include "rpiConfig.h" -#elif defined(XIPHOS_Q7S) -#include "q7sConfig.h" -#endif #include "commonConfig.h" #include "OBSWVersion.h" @@ -45,7 +40,7 @@ debugging. */ #define OBSW_ENABLE_TIMERS 1 #define OBSW_ADD_MGT 1 #define OBSW_ADD_BPX_BATTERY_HANDLER 1 -#define OBSW_ADD_STAR_TRACKER 0 +#define OBSW_ADD_STAR_TRACKER @OBSW_ADD_STAR_TRACKER@ #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_SUN_SENSORS 1 @@ -68,11 +63,7 @@ debugging. */ // at the wrong place. The system component might command all the Switches accordingly anyway #define OBSW_INITIALIZE_SWITCHES 0 -#endif - -#ifdef EGSE -#define OBSW_ADD_STAR_TRACKER 1 -#endif +#endif // XIPHOS_Q7S /*******************************************************************/ /** All of the following flags should be disabled for mission code */ @@ -126,12 +117,7 @@ debugging. */ #define OBSW_DEBUG_PLOC_MPSOC 0 #define OBSW_DEBUG_PLOC_SUPERVISOR 0 #define OBSW_DEBUG_PDEC_HANDLER 0 - -#ifdef EGSE -#define OBSW_DEBUG_STARTRACKER 1 -#else -#define OBSW_DEBUG_STARTRACKER 0 -#endif +#define OBSW_DEBUG_STARTRACKER @OBSW_DEBUG_STARTRACKER@ #ifdef RASPBERRY_PI @@ -149,14 +135,15 @@ debugging. */ #define OBSW_ADD_RAD_SENSORS 0 #define OBSW_ADD_SYRLINKS 0 -#endif +#endif // RASPBERRY_PI -/*******************************************************************/ -/** CMake Defines */ -/*******************************************************************/ #cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER -#include "OBSWVersion.h" +#ifdef RASPBERRY_PI +#include "rpiConfig.h" +#elif defined(XIPHOS_Q7S) +#include "q7sConfig.h" +#endif #ifdef __cplusplus @@ -167,13 +154,6 @@ debugging. */ namespace config { #endif -/* Add mission configuration flags here */ -static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50; -static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50; -static constexpr uint32_t STR_IMG_HELPER_QUEUE_SIZE = 50; - -static constexpr uint8_t LIVE_TM = 0; - #ifdef __cplusplus } #endif diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 1e450725..782b9bd0 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -19,7 +19,7 @@ #include #include "OBSWConfig.h" -#include "definitions.h" +#include "eive/definitions.h" #include "objects/systemObjectList.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" diff --git a/mission/tmtc/CCSDSHandler.cpp b/mission/tmtc/CCSDSHandler.cpp index d6c2367b..dcffe5f9 100644 --- a/mission/tmtc/CCSDSHandler.cpp +++ b/mission/tmtc/CCSDSHandler.cpp @@ -12,7 +12,7 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination, PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, - gpioId_t enTxData) + gpioId_t enTxData, uint32_t transmitterTimeout) : SystemObject(objectId), ptmeId(ptmeId), tcDestination(tcDestination), @@ -21,7 +21,8 @@ CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t ptmeConfig(ptmeConfig), gpioIF(gpioIF), enTxClock(enTxClock), - enTxData(enTxData) { + enTxData(enTxData), + TRANSMITTER_TIMEOUT(transmitterTimeout) { commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE); auto mqArgs = MqArgs(objectId, static_cast(this)); eventQueue = diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 284cbcba..75727cb8 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -51,7 +51,8 @@ class CCSDSHandler : public SystemObject, * @param enTxData GPIO ID of RS485 tx data enable */ CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination, - PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData); + PtmeConfig* ptmeConfig, GpioIF* gpioIF, gpioId_t enTxClock, gpioId_t enTxData, + uint32_t transmitterTimeout = 900000); ~CCSDSHandler(); @@ -104,13 +105,9 @@ class CCSDSHandler : public SystemObject, //! [EXPORT] : [COMMENT] Received action message with unknown action id static const ReturnValue_t COMMAND_NOT_IMPLEMENTED = MAKE_RETURN_CODE(0xA0); -#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1 // syrlinks must not be transmitting more than 15 minutes (according to datasheet) - static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min -#else - // Set to high value when not sending via syrlinks - static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day -#endif /* OBSW_SYRLINKS_DOWNLINK == 0 */ + // Value can be configured via CTOR argument to allow test setups + const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min static const bool UP = true; static const bool DOWN = false;