From 6d2d7ad620cb7bd669abb1524b52ecf3e142196d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sun, 14 Feb 2021 18:30:12 +0100 Subject: [PATCH] moved heater handler --- bsp_q7s/CMakeLists.txt | 1 + bsp_q7s/ObjectFactory.cpp | 18 +++++++++--------- bsp_q7s/devices/CMakeLists.txt | 7 +++++++ {mission => bsp_q7s}/devices/HeaterHandler.cpp | 13 +++++++------ {mission => bsp_q7s}/devices/HeaterHandler.h | 2 +- mission/devices/CMakeLists.txt | 1 - 6 files changed, 25 insertions(+), 17 deletions(-) create mode 100644 bsp_q7s/devices/CMakeLists.txt rename {mission => bsp_q7s}/devices/HeaterHandler.cpp (97%) rename {mission => bsp_q7s}/devices/HeaterHandler.h (99%) diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index 3d3a1c91..7b985558 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -6,6 +6,7 @@ target_sources(${TARGET_NAME} PUBLIC add_subdirectory(boardconfig) add_subdirectory(comIF) +add_subdirectory(devices) add_subdirectory(boardtest) diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index a4503981..aed9e23e 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -4,15 +4,9 @@ #include #include #include +#include -#include -#include -#include -#include -#include -#include - -#include +#include #include #include @@ -21,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +26,13 @@ #include #include +#include +#include +#include +#include +#include +#include + #if TEST_LIBGPIOD == 1 #include "LibgpiodTest.h" #endif diff --git a/bsp_q7s/devices/CMakeLists.txt b/bsp_q7s/devices/CMakeLists.txt new file mode 100644 index 00000000..14eae324 --- /dev/null +++ b/bsp_q7s/devices/CMakeLists.txt @@ -0,0 +1,7 @@ +target_sources(${TARGET_NAME} PRIVATE + HeaterHandler.cpp +) + + + + diff --git a/mission/devices/HeaterHandler.cpp b/bsp_q7s/devices/HeaterHandler.cpp similarity index 97% rename from mission/devices/HeaterHandler.cpp rename to bsp_q7s/devices/HeaterHandler.cpp index a810e2a6..759c6d64 100644 --- a/mission/devices/HeaterHandler.cpp +++ b/bsp_q7s/devices/HeaterHandler.cpp @@ -1,15 +1,16 @@ -#include +#include "HeaterHandler.h" + #include #include #include HeaterHandler::HeaterHandler(object_id_t setObjectId_, object_id_t gpioDriverId_, CookieIF * gpioCookie_, object_id_t mainLineSwitcherObjectId_, uint8_t mainLineSwitch_) : - SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), gpioCookie(gpioCookie_), mainLineSwitcherObjectId( - mainLineSwitcherObjectId_), mainLineSwitch(mainLineSwitch_), actionHelper(this, - nullptr) { - commandQueue = QueueFactory::instance()->createMessageQueue(cmdQueueSize, - MessageQueueMessage::MAX_MESSAGE_SIZE); + SystemObject(setObjectId_), gpioDriverId(gpioDriverId_), gpioCookie(gpioCookie_), + mainLineSwitcherObjectId(mainLineSwitcherObjectId_), mainLineSwitch(mainLineSwitch_), + actionHelper(this, nullptr) { + commandQueue = QueueFactory::instance()->createMessageQueue( + cmdQueueSize, MessageQueueMessage::MAX_MESSAGE_SIZE); } HeaterHandler::~HeaterHandler() { diff --git a/mission/devices/HeaterHandler.h b/bsp_q7s/devices/HeaterHandler.h similarity index 99% rename from mission/devices/HeaterHandler.h rename to bsp_q7s/devices/HeaterHandler.h index 4c37c30f..5406df8d 100644 --- a/mission/devices/HeaterHandler.h +++ b/bsp_q7s/devices/HeaterHandler.h @@ -117,7 +117,7 @@ private: CookieIF * gpioCookie; - GpioIF* gpioInterface; + GpioIF* gpioInterface = nullptr; /** Queue to receive messages from other objects. */ MessageQueueIF* commandQueue = nullptr; diff --git a/mission/devices/CMakeLists.txt b/mission/devices/CMakeLists.txt index 9a2920d5..a8205276 100644 --- a/mission/devices/CMakeLists.txt +++ b/mission/devices/CMakeLists.txt @@ -10,7 +10,6 @@ target_sources(${TARGET_NAME} PUBLIC PDU1Handler.cpp PDU2Handler.cpp ACUHandler.cpp - HeaterHandler.cpp )