From 546273d5b8c8ee58d2b90f4f979199e94e1e3479 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 26 May 2021 14:16:16 +0200 Subject: [PATCH] added core controller stub --- bsp_q7s/CMakeLists.txt | 4 +-- bsp_q7s/ObjectFactory.cpp | 37 ++++++++++----------- bsp_q7s/core/CMakeLists.txt | 3 ++ bsp_q7s/core/CoreController.cpp | 26 +++++++++++++++ bsp_q7s/core/CoreController.h | 22 ++++++++++++ common/config/commonObjects.h | 6 ++++ fsfw | 2 +- linux/fsfwconfig/objects/systemObjectList.h | 9 ++--- 8 files changed, 79 insertions(+), 30 deletions(-) create mode 100644 bsp_q7s/core/CMakeLists.txt create mode 100644 bsp_q7s/core/CoreController.cpp create mode 100644 bsp_q7s/core/CoreController.h diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index f741a46b..ce790656 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -8,6 +8,4 @@ add_subdirectory(boardconfig) add_subdirectory(comIF) add_subdirectory(boardtest) add_subdirectory(gpio) - - - +add_subdirectory(core) diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 6629c0bd..c2eefa51 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -7,11 +7,15 @@ #include "devices/powerSwitcherList.h" #include "spiConf.h" -#include +#include "bsp_q7s/gpio/gpioCallbacks.h" +#include "bsp_q7s/core/CoreController.h" #include #include +#include #include +#include +#include #include #include @@ -28,8 +32,6 @@ #include #include #include - -#include #include #include #include @@ -37,13 +39,8 @@ #include #include -#include -#include - -#include -#include - - +#include "fsfw_hal/linux/uart/UartComIF.h" +#include "fsfw_hal/linux/uart/UartCookie.h" #include #include #include @@ -87,6 +84,17 @@ void Factory::setStaticFrameworkObjectIds() { void ObjectFactory::produce(){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); + LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); + + /* Communication interfaces */ + new CspComIF(objects::CSP_COM_IF); + new I2cComIF(objects::I2C_COM_IF); + new UartComIF(objects::UART_COM_IF); +#if Q7S_ADD_SPI_TEST == 0 + new SpiComIF(objects::SPI_COM_IF, gpioComIF); +#endif /* Q7S_ADD_SPI_TEST == 0 */ + + new CoreController(objects::CORE_CONTROLLER); #if TE0720 == 1 I2cCookie* i2cCookieTmp1075tcs1 = new I2cCookie(addresses::TMP1075_TCS_1, @@ -99,15 +107,6 @@ void ObjectFactory::produce(){ I2cCookie* i2cCookieTmp1075tcs2 = new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-1")); #endif - LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); - - /* Communication interfaces */ - new CspComIF(objects::CSP_COM_IF); - new I2cComIF(objects::I2C_COM_IF); - new UartComIF(objects::UART_COM_IF); -#if Q7S_ADD_SPI_TEST == 0 - new SpiComIF(objects::SPI_COM_IF, gpioComIF); -#endif /* Q7S_ADD_SPI_TEST == 0 */ /* Temperature sensors */ Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler( diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt new file mode 100644 index 00000000..4b2364c1 --- /dev/null +++ b/bsp_q7s/core/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${TARGET_NAME} PRIVATE + CoreController.cpp +) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp new file mode 100644 index 00000000..253efd91 --- /dev/null +++ b/bsp_q7s/core/CoreController.cpp @@ -0,0 +1,26 @@ +#include "CoreController.h" + +CoreController::CoreController(object_id_t objectId): + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5) { +} + +ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { + return HasReturnvaluesIF::RETURN_OK; +} + +void CoreController::performControlOperation() { +} + +ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} + +LocalPoolDataSetBase* CoreController::getDataSetHandle(sid_t sid) { + return nullptr; +} + +ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode) { + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h new file mode 100644 index 00000000..bc8a1581 --- /dev/null +++ b/bsp_q7s/core/CoreController.h @@ -0,0 +1,22 @@ +#ifndef BSP_Q7S_CORE_CORECONTROLLER_H_ +#define BSP_Q7S_CORE_CORECONTROLLER_H_ + +#include "fsfw/controller/ExtendedControllerBase.h" + +class CoreController: public ExtendedControllerBase { +public: + CoreController(object_id_t objectId); + + ReturnValue_t handleCommandMessage(CommandMessage *message) override; + void performControlOperation() override; +private: + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode); +}; + + + +#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index fd7e5a92..3baf58b0 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -11,6 +11,12 @@ enum commonObjects: uint32_t { UDP_BRIDGE = 0x50000300, UDP_POLLING_TASK = 0x50000400, + /* 0x43 ('C') for Controllers */ + THERMAL_CONTROLLER = 0x43001000, + ATTITUDE_CONTROLLER = 0x43002000, + ACS_CONTROLLER = 0x43003000, + CORE_CONTROLLER = 0x43004000, + /* 0x44 ('D') for device handlers */ P60DOCK_HANDLER = 0x44000001, PDU1_HANDLER = 0x44000002, diff --git a/fsfw b/fsfw index e9adaf67..5d2c62e7 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e9adaf672f7bfac9aaa03c284410b318142431ff +Subproject commit 5d2c62e75de447a3aed1fde78e8654f9ce8e1205 diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 95730e09..3f7fddc4 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -1,9 +1,9 @@ #ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ -#include +#include "commonObjects.h" #include -#include +#include // The objects will be instantiated in the ID order namespace objects { @@ -12,12 +12,7 @@ namespace objects { FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, FW_ADDRESS_END = TIME_STAMPER, - PUS_SERVICE_3 = 0x51000300, - PUS_SERVICE_5 = 0x51000400, PUS_SERVICE_6 = 0x51000500, - PUS_SERVICE_8 = 0x51000800, - PUS_SERVICE_23 = 0x51002300, - PUS_SERVICE_201 = 0x51020100, TM_FUNNEL = 0x52000002,