From 8ebc62cbe6b406f0a39f630538a751fbbfd11e26 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Sep 2022 13:03:22 +0200 Subject: [PATCH] new ACS preproc defines --- CMakeLists.txt | 9 ++++++--- bsp_q7s/OBSWConfig.h.in | 3 ++- bsp_q7s/core/InitMission.cpp | 10 +++++----- bsp_q7s/core/ObjectFactory.cpp | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b8190ec..03c1eece 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,11 +95,14 @@ set(OBSW_ADD_SUS_BOARD_ASS set(OBSW_ADD_ACS_BOARD ${INIT_VAL} CACHE STRING "Add ACS board module") -set(OBSW_ADD_ACS_HANDLERS +set(OBSW_ADD_GPS_CTRL ${INIT_VAL} - CACHE STRING "Add ACS handlers") + CACHE STRING "Add GPS controllers") +set(OBSW_ADD_ACS_CTRL + ${INIT_VAL} + CACHE STRING "Add ACS controller") set(OBSW_ADD_RTD_DEVICES - ${INIT_VAL} + 1 CACHE STRING "Add RTD devices") set(OBSW_ADD_RAD_SENSORS ${INIT_VAL} diff --git a/bsp_q7s/OBSWConfig.h.in b/bsp_q7s/OBSWConfig.h.in index b9c27840..c20db3f1 100644 --- a/bsp_q7s/OBSWConfig.h.in +++ b/bsp_q7s/OBSWConfig.h.in @@ -30,7 +30,8 @@ #define OBSW_ADD_SUN_SENSORS @OBSW_ADD_SUN_SENSORS@ #define OBSW_ADD_SUS_BOARD_ASS @OBSW_ADD_SUS_BOARD_ASS@ #define OBSW_ADD_ACS_BOARD @OBSW_ADD_ACS_BOARD@ -#define OBSW_ADD_ACS_HANDLERS @OBSW_ADD_ACS_HANDLERS@ +#define OBSW_ADD_ACS_CTRL @OBSW_ADD_ACS_CTRL@ +#define OBSW_ADD_GPS_CTRL @OBSW_ADD_GPS_CTRL@ #define OBSW_ADD_RW @OBSW_ADD_RW@ #define OBSW_ADD_RTD_DEVICES @OBSW_ADD_RTD_DEVICES@ #define OBSW_ADD_TMP_DEVICES @OBSW_ADD_TMP_DEVICES@ diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index c6f7ce51..e60c2caf 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -126,22 +126,24 @@ void initmission::initTasks() { PeriodicTaskIF* acsTask = factory->createPeriodicTask( "ACS_TASK", 50, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); -#if OBSW_ADD_ACS_HANDLERS == 1 +#if OBSW_ADD_GPS_CTRL == 1 result = acsTask->addComponent(objects::GPS_CONTROLLER); if (result != returnvalue::OK) { initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } -#endif /* OBSW_ADD_ACS_HANDLERS */ +#endif /* OBSW_ADD_GPS_CTRL */ +#if OBSW_ADD_ACS_CTRL == 1 acsTask->addComponent(objects::ACS_CONTROLLER); if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_CTRL", objects::ACS_CONTROLLER); } +#endif PeriodicTaskIF* sysTask = factory->createPeriodicTask( "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); static_cast(sysTask); -#if OBSW_ADD_ACS_HANDLERS == 1 +#if OBSW_ADD_ACS_BOARD == 1 result = sysTask->addComponent(objects::ACS_BOARD_ASS); if (result != returnvalue::OK) { initmission::printAddObjectError("ACS_BOARD_ASS", objects::ACS_BOARD_ASS); @@ -293,9 +295,7 @@ 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(); diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 6627d90d..f8e604a8 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -331,7 +331,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI AcsBoardFdir* fdir = nullptr; static_cast(fdir); -#if OBSW_ADD_ACS_HANDLERS == 1 +#if OBSW_ADD_ACS_BOARD == 1 std::string spiDev = q7s::SPI_DEFAULT_DEV; SpiCookie* spiCookie = new SpiCookie(addresses::MGM_0_LIS3, gpioIds::MGM_0_LIS3_CS, MGMLIS3MDL::MAX_BUFFER_SIZE,