From 243af65ca6a74c595fdfd4e2d806bd46ee080d2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 26 Mar 2022 14:08:34 +0100 Subject: [PATCH] fix compile warnings for RPI build --- linux/fsfwconfig/OBSWConfig.h.in | 13 ++++++++----- mission/core/GenericFactory.cpp | 10 +++++++++- mission/tmtc/CCSDSHandler.h | 8 ++++---- mission/utility/TmFunnel.cpp | 11 +++-------- mission/utility/TmFunnel.h | 6 ++++-- 5 files changed, 28 insertions(+), 20 deletions(-) diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index 6266742c..5abe4e3f 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -20,6 +20,7 @@ debugging. */ //! Board defines #define BOARD_TE0720 0 +#define Q7S_EM 0 /*******************************************************************/ /** All of the following flags should be enabled for mission code */ @@ -29,8 +30,6 @@ debugging. */ //! All of this should be enabled for mission code! #if defined XIPHOS_Q7S -#define Q7S_EM 0 - #define OBSW_USE_CCSDS_IP_CORE 1 // Set to 1 if all telemetry should be sent to the PTME IP Core #define OBSW_TM_TO_PTME 0 @@ -54,7 +53,8 @@ debugging. */ #define OBSW_ADD_SYRLINKS 0 #define OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT 0 #define OBSW_STAR_TRACKER_GROUND_CONFIG 1 -#define OBSW_ENABLE_PERIODIC_HK 0 + +#endif // XIPHOS_Q7S // This is a really tricky switch.. It initializes the PCDU switches to their default states // at powerup. I think it would be better @@ -62,8 +62,7 @@ debugging. */ // something the operators might want to do by giving the software too much intelligence // at the wrong place. The system component might command all the Switches accordingly anyway #define OBSW_INITIALIZE_SWITCHES 0 - -#endif // XIPHOS_Q7S +#define OBSW_ENABLE_PERIODIC_HK 0 /*******************************************************************/ /** All of the following flags should be disabled for mission code */ @@ -126,14 +125,18 @@ debugging. */ #define OBSW_ADD_PLOC_SUPERVISOR 0 #define OBSW_ADD_PLOC_MPSOC 0 #define OBSW_ADD_SUN_SENSORS 0 +#define OBSW_ADD_MGT 0 #define OBSW_ADD_ACS_BOARD 0 #define OBSW_ADD_GPS_0 0 #define OBSW_ADD_GPS_1 0 #define OBSW_ADD_RW 0 +#define OBSW_ADD_BPX_BATTERY_HANDLER 0 #define OBSW_ADD_RTD_DEVICES 0 +#define OBSW_ADD_PL_PCDU 0 #define OBSW_ADD_TMP_DEVICES 0 #define OBSW_ADD_RAD_SENSORS 0 #define OBSW_ADD_SYRLINKS 0 +#define OBSW_STAR_TRACKER_GROUND_CONFIG 1 #endif // RASPBERRY_PI diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 782b9bd0..1e93a15a 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -40,6 +40,10 @@ #include #endif +#ifndef OBSW_TM_TO_PTME +#define OBSW_TM_TO_PTME 0 +#endif + void ObjectFactory::produceGenericObjects() { // Framework objects new EventManager(objects::EVENT_MANAGER); @@ -69,8 +73,12 @@ void ObjectFactory::produceGenericObjects() { new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR, objects::CCSDS_PACKET_DISTRIBUTOR); + uint8_t vc = 0; +#if OBSW_TM_TO_PTME == 1 + vc = config::LIVE_TM; +#endif // Every TM packet goes through this funnel - new TmFunnel(objects::TM_FUNNEL, 50); + new TmFunnel(objects::TM_FUNNEL, 50, vc); // PUS service stack new Service1TelecommandVerification(objects::PUS_SERVICE_1_VERIFICATION, apid::EIVE_OBSW, diff --git a/mission/tmtc/CCSDSHandler.h b/mission/tmtc/CCSDSHandler.h index 75727cb8..f6f2fff3 100644 --- a/mission/tmtc/CCSDSHandler.h +++ b/mission/tmtc/CCSDSHandler.h @@ -105,10 +105,6 @@ class CCSDSHandler : public SystemObject, //! [EXPORT] : [COMMENT] Received action message with unknown action id static const ReturnValue_t COMMAND_NOT_IMPLEMENTED = MAKE_RETURN_CODE(0xA0); - // syrlinks must not be transmitting more than 15 minutes (according to datasheet) - // 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; @@ -137,6 +133,10 @@ class CCSDSHandler : public SystemObject, gpioId_t enTxClock = gpio::NO_GPIO; gpioId_t enTxData = gpio::NO_GPIO; + // syrlinks must not be transmitting more than 15 minutes (according to datasheet) + // Value can be configured via CTOR argument to allow test setups + const uint32_t TRANSMITTER_TIMEOUT = 900000; // 900000 ms = 15 min + // Countdown to disable transmitter after 15 minutes Countdown transmitterCountdown; diff --git a/mission/utility/TmFunnel.cpp b/mission/utility/TmFunnel.cpp index e22eabdf..c47c7f9d 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/utility/TmFunnel.cpp @@ -9,8 +9,8 @@ object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT; object_id_t TmFunnel::storageDestination = objects::NO_OBJECT; -TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth) - : SystemObject(objectId), messageDepth(messageDepth) { +TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth, uint8_t reportReceptionVc) + : SystemObject(objectId), messageDepth(messageDepth), reportReceptionVc(reportReceptionVc) { auto mqArgs = MqArgs(objectId, static_cast(this)); tmQueue = QueueFactory::instance()->createMessageQueue( messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE, &mqArgs); @@ -97,12 +97,7 @@ ReturnValue_t TmFunnel::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } -#if OBSW_TM_TO_PTME == 1 - // Live TM will be sent via the virtual channel 0 - tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue(config::LIVE_TM)); -#else - tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue()); -#endif /* OBSW_TM_TO_PTME == 1 */ + tmQueue->setDefaultDestination(tmTarget->getReportReceptionQueue(reportReceptionVc)); // Storage destination is optional. if (storageDestination == objects::NO_OBJECT) { diff --git a/mission/utility/TmFunnel.h b/mission/utility/TmFunnel.h index 013e0ebc..b0980c28 100644 --- a/mission/utility/TmFunnel.h +++ b/mission/utility/TmFunnel.h @@ -23,7 +23,7 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy friend void(Factory::setStaticFrameworkObjectIds)(); public: - TmFunnel(object_id_t objectId, uint32_t messageDepth = 20); + TmFunnel(object_id_t objectId, uint32_t messageDepth = 20, uint8_t reportReceptionVc = 0); virtual ~TmFunnel(); virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; @@ -35,12 +35,14 @@ class TmFunnel : public AcceptsTelemetryIF, public ExecutableObjectIF, public Sy static object_id_t storageDestination; private: + uint32_t messageDepth = 0; + uint8_t reportReceptionVc = 0; uint16_t sourceSequenceCount = 0; MessageQueueIF* tmQueue = nullptr; MessageQueueIF* storageQueue = nullptr; StorageManagerIF* tmStore = nullptr; - uint32_t messageDepth = 0; + ReturnValue_t handlePacket(TmTcMessage* message); };