From 27ee6bfffcdefa593cf48a68ebe9fd3bc6f7cb87 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 22 Feb 2022 13:50:46 +0100 Subject: [PATCH] fixes for RPi build --- bsp_linux_board/CMakeLists.txt | 2 +- bsp_linux_board/InitMission.cpp | 5 +++-- bsp_linux_board/ObjectFactory.cpp | 19 ++++--------------- bsp_linux_board/boardconfig/CMakeLists.txt | 4 ++-- bsp_linux_board/boardtest/CMakeLists.txt | 2 +- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/bsp_linux_board/CMakeLists.txt b/bsp_linux_board/CMakeLists.txt index 5963d48c..0272f476 100644 --- a/bsp_linux_board/CMakeLists.txt +++ b/bsp_linux_board/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PUBLIC +target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 86d5fb4b..b8da1b3e 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -211,7 +211,7 @@ void initmission::createTestTasks(TaskFactory& factory, if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("TEST_TASK", objects::TEST_TASK); } -#if RPI_ADD_SPI_TEST == 1 +#if OBSW_ADD_SPI_TEST_CODE == 1 result = testTask->addComponent(objects::SPI_TEST); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("SPI_TEST", objects::SPI_TEST); @@ -223,12 +223,13 @@ void initmission::createTestTasks(TaskFactory& factory, initmission::printAddObjectError("GPIOD_TEST", objects::LIBGPIOD_TEST); } #endif /* RPI_ADD_GPIO_TEST == 1 */ -#if RPI_ADD_UART_TEST == 1 +#if OBSW_ADD_UART_TEST_CODE == 1 result = testTask->addComponent(objects::UART_TEST); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("UART_TEST", objects::UART_TEST); } #endif /* RPI_ADD_GPIO_TEST == 1 */ + taskVec.push_back(testTask); bool startTestPst = true; static_cast(startTestPst); diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 71966164..18da8896 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -1,9 +1,7 @@ #include "ObjectFactory.h" -#include -#include - #include "OBSWConfig.h" +#include "devConf.h" #include "devices/addresses.h" #include "devices/gpioIds.h" #include "fsfw/datapoollocal/LocalDataPoolManager.h" @@ -15,6 +13,7 @@ #include "linux/boardtest/SpiTestClass.h" #include "linux/boardtest/UartTestClass.h" #include "mission/core/GenericFactory.h" +#include "mission/devices/GPSHyperionHandler.h" #include "mission/devices/GyroADIS1650XHandler.h" #include "mission/utility/TmFunnel.h" #include "objects/systemObjectList.h" @@ -61,16 +60,6 @@ void ObjectFactory::produce(void* args) { Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); -#if OBSW_USE_TMTC_TCP_BRIDGE == 1 - auto tmtcBridge = new TcpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); - tmtcBridge->setMaxNumberOfPacketsStored(50); - new TcpTmTcServer(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); -#else - auto tmtcBridge = new UdpTmTcBridge(objects::TMTC_BRIDGE, objects::CCSDS_PACKET_DISTRIBUTOR); - tmtcBridge->setMaxNumberOfPacketsStored(50); - new UdpTcPollingTask(objects::TMTC_POLLING_TASK, objects::TMTC_BRIDGE); -#endif - GpioIF* gpioIF = new LinuxLibgpioIF(objects::GPIO_IF); GpioCookie* gpioCookie = nullptr; static_cast(gpioCookie); @@ -188,11 +177,11 @@ void ObjectFactory::produce(void* args) { void ObjectFactory::createTestTasks() { new TestTask(objects::TEST_TASK); -#if RPI_ADD_SPI_TEST == 1 +#if OBSW_ADD_SPI_TEST_CODE == 1 new SpiTestClass(objects::SPI_TEST, gpioIF); #endif -#if RPI_ADD_UART_TEST == 1 +#if OBSW_ADD_UART_TEST_CODE == 1 new UartTestClass(objects::UART_TEST); #else new UartComIF(objects::UART_COM_IF); diff --git a/bsp_linux_board/boardconfig/CMakeLists.txt b/bsp_linux_board/boardconfig/CMakeLists.txt index 67fbaf88..f9136e3e 100644 --- a/bsp_linux_board/boardconfig/CMakeLists.txt +++ b/bsp_linux_board/boardconfig/CMakeLists.txt @@ -1,7 +1,7 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE print.c ) -target_include_directories(${TARGET_NAME} PUBLIC +target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) diff --git a/bsp_linux_board/boardtest/CMakeLists.txt b/bsp_linux_board/boardtest/CMakeLists.txt index 0599b73f..fe4910f2 100644 --- a/bsp_linux_board/boardtest/CMakeLists.txt +++ b/bsp_linux_board/boardtest/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${TARGET_NAME} PRIVATE +target_sources(${OBSW_NAME} PRIVATE )