diff --git a/CMakeLists.txt b/CMakeLists.txt index c75d711fe..b78653009 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ endif() option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON) # Options to exclude parts of the FSFW from compilation. option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON) +option(FSFW_ADD_HAL "Add Hardware Abstraction Layer" ON) # Optional sources option(FSFW_ADD_PUS "Compile with PUS sources" ON) @@ -21,7 +22,7 @@ option(FSFW_ADD_COORDINATES "Compile with coordinate components" OFF) option(FSFW_ADD_TMSTORAGE "Compile with tm storage components" OFF) # Contrib sources -option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" OFF) +option(FSFW_ADD_SGP4_PROPAGATOR "Add SGP4 propagator code" OFF) set(LIB_FSFW_NAME fsfw) add_library(${LIB_FSFW_NAME}) @@ -94,7 +95,9 @@ message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.") add_subdirectory(src) add_subdirectory(tests) -add_subdirectory(hal) +if(FSFW_ADD_HAL) + add_subdirectory(hal) +endif() add_subdirectory(contrib) # The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it. diff --git a/README.md b/README.md index 484d65c07..48d2b8e7f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![FSFW Logo](logo/FSFW_Logo_V3_bw.png) +![FSFW Logo](misc/logo/FSFW_Logo_V3_bw.png) # Flight Software Framework (FSFW) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 3a987228a..e83da6afa 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,11 +1,9 @@ -if(FSFW_ADD_SPG4_PROPAGATOR) - target_sources(${LIB_FSFW_NAME} PRIVATE - sgp4/sgp4unit.cpp - ) - target_include_directories(${LIB_FSFW_NAME} PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/sgp4 - ) - target_include_directories(${LIB_FSFW_NAME} INTERFACE - ${CMAKE_CURRENT_SOURCE_DIR}/sgp4 - ) -endif() +target_include_directories(${LIB_FSFW_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_include_directories(${LIB_FSFW_NAME} INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +add_subdirectory(fsfw_contrib) diff --git a/contrib/fsfw_contrib/CMakeLists.txt b/contrib/fsfw_contrib/CMakeLists.txt new file mode 100644 index 000000000..3a7e4182a --- /dev/null +++ b/contrib/fsfw_contrib/CMakeLists.txt @@ -0,0 +1,11 @@ +if(FSFW_ADD_SGP4_PROPAGATOR) + target_sources(${LIB_FSFW_NAME} PRIVATE + sgp4/sgp4unit.cpp + ) + target_include_directories(${LIB_FSFW_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/sgp4 + ) + target_include_directories(${LIB_FSFW_NAME} INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR}/sgp4 + ) +endif() diff --git a/contrib/sgp4/LICENSE b/contrib/fsfw_contrib/sgp4/LICENSE similarity index 100% rename from contrib/sgp4/LICENSE rename to contrib/fsfw_contrib/sgp4/LICENSE diff --git a/contrib/sgp4/sgp4unit.cpp b/contrib/fsfw_contrib/sgp4/sgp4unit.cpp similarity index 100% rename from contrib/sgp4/sgp4unit.cpp rename to contrib/fsfw_contrib/sgp4/sgp4unit.cpp diff --git a/contrib/sgp4/sgp4unit.h b/contrib/fsfw_contrib/sgp4/sgp4unit.h similarity index 100% rename from contrib/sgp4/sgp4unit.h rename to contrib/fsfw_contrib/sgp4/sgp4unit.h diff --git a/hal/src/CMakeLists.txt b/hal/src/CMakeLists.txt index ed2f2522e..76ee45c6d 100644 --- a/hal/src/CMakeLists.txt +++ b/hal/src/CMakeLists.txt @@ -6,4 +6,4 @@ target_include_directories(${LIB_FSFW_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -add_subdirectory(fsfw) +add_subdirectory(fsfw_hal) diff --git a/hal/src/fsfw/CMakeLists.txt b/hal/src/fsfw/CMakeLists.txt deleted file mode 100644 index c034e0b73..000000000 --- a/hal/src/fsfw/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(hal) diff --git a/hal/src/fsfw/hal/CMakeLists.txt b/hal/src/fsfw_hal/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/CMakeLists.txt rename to hal/src/fsfw_hal/CMakeLists.txt diff --git a/hal/src/fsfw/hal/common/CMakeLists.txt b/hal/src/fsfw_hal/common/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/common/CMakeLists.txt rename to hal/src/fsfw_hal/common/CMakeLists.txt diff --git a/hal/src/fsfw/hal/common/gpio/CMakeLists.txt b/hal/src/fsfw_hal/common/gpio/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/common/gpio/CMakeLists.txt rename to hal/src/fsfw_hal/common/gpio/CMakeLists.txt diff --git a/hal/src/fsfw/hal/common/gpio/GpioCookie.cpp b/hal/src/fsfw_hal/common/gpio/GpioCookie.cpp similarity index 97% rename from hal/src/fsfw/hal/common/gpio/GpioCookie.cpp rename to hal/src/fsfw_hal/common/gpio/GpioCookie.cpp index 31832070a..7c56ebcfe 100644 --- a/hal/src/fsfw/hal/common/gpio/GpioCookie.cpp +++ b/hal/src/fsfw_hal/common/gpio/GpioCookie.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/common/gpio/GpioCookie.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" #include "fsfw/serviceinterface/ServiceInterface.h" GpioCookie::GpioCookie() { diff --git a/hal/src/fsfw/hal/common/gpio/GpioCookie.h b/hal/src/fsfw_hal/common/gpio/GpioCookie.h similarity index 100% rename from hal/src/fsfw/hal/common/gpio/GpioCookie.h rename to hal/src/fsfw_hal/common/gpio/GpioCookie.h diff --git a/hal/src/fsfw/hal/common/gpio/GpioIF.h b/hal/src/fsfw_hal/common/gpio/GpioIF.h similarity index 100% rename from hal/src/fsfw/hal/common/gpio/GpioIF.h rename to hal/src/fsfw_hal/common/gpio/GpioIF.h diff --git a/hal/src/fsfw/hal/common/gpio/gpioDefinitions.h b/hal/src/fsfw_hal/common/gpio/gpioDefinitions.h similarity index 100% rename from hal/src/fsfw/hal/common/gpio/gpioDefinitions.h rename to hal/src/fsfw_hal/common/gpio/gpioDefinitions.h diff --git a/hal/src/fsfw/hal/common/spi/spiCommon.h b/hal/src/fsfw_hal/common/spi/spiCommon.h similarity index 100% rename from hal/src/fsfw/hal/common/spi/spiCommon.h rename to hal/src/fsfw_hal/common/spi/spiCommon.h diff --git a/hal/src/fsfw/hal/devicehandlers/CMakeLists.txt b/hal/src/fsfw_hal/devicehandlers/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/devicehandlers/CMakeLists.txt rename to hal/src/fsfw_hal/devicehandlers/CMakeLists.txt diff --git a/hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.cpp b/hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp similarity index 99% rename from hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.cpp rename to hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp index 11f7e92d0..96d284e18 100644 --- a/hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.cpp +++ b/hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/devicehandlers/GyroL3GD20Handler.h" +#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h" #include "fsfw/datapool/PoolReadGuard.h" diff --git a/hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.h b/hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.h similarity index 97% rename from hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.h rename to hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.h index f82ba9359..020c5a32e 100644 --- a/hal/src/fsfw/hal/devicehandlers/GyroL3GD20Handler.h +++ b/hal/src/fsfw_hal/devicehandlers/GyroL3GD20Handler.h @@ -1,14 +1,14 @@ #ifndef MISSION_DEVICES_GYROL3GD20HANDLER_H_ #define MISSION_DEVICES_GYROL3GD20HANDLER_H_ -#include "OBSWConfig.h" +#include "fsfw/FSFW.h" #include "devicedefinitions/GyroL3GD20Definitions.h" #include #include #ifndef FSFW_HAL_L3GD20_GYRO_DEBUG -#define FSFW_HAL_L3GD20_GYRO_DEBUG 1 +#define FSFW_HAL_L3GD20_GYRO_DEBUG 0 #endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */ /** diff --git a/hal/src/fsfw/hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h b/hal/src/fsfw_hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h similarity index 100% rename from hal/src/fsfw/hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h rename to hal/src/fsfw_hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h diff --git a/hal/src/fsfw/hal/host/CMakeLists.txt b/hal/src/fsfw_hal/host/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/host/CMakeLists.txt rename to hal/src/fsfw_hal/host/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/CMakeLists.txt b/hal/src/fsfw_hal/linux/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/CMakeLists.txt rename to hal/src/fsfw_hal/linux/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/UnixFileGuard.cpp b/hal/src/fsfw_hal/linux/UnixFileGuard.cpp similarity index 96% rename from hal/src/fsfw/hal/linux/UnixFileGuard.cpp rename to hal/src/fsfw_hal/linux/UnixFileGuard.cpp index c47e35b19..f79010189 100644 --- a/hal/src/fsfw/hal/linux/UnixFileGuard.cpp +++ b/hal/src/fsfw_hal/linux/UnixFileGuard.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/linux/UnixFileGuard.h" +#include "fsfw_hal/linux/UnixFileGuard.h" UnixFileGuard::UnixFileGuard(std::string device, int* fileDescriptor, int flags, std::string diagnosticPrefix): diff --git a/hal/src/fsfw/hal/linux/UnixFileGuard.h b/hal/src/fsfw_hal/linux/UnixFileGuard.h similarity index 100% rename from hal/src/fsfw/hal/linux/UnixFileGuard.h rename to hal/src/fsfw_hal/linux/UnixFileGuard.h diff --git a/hal/src/fsfw/hal/linux/gpio/CMakeLists.txt b/hal/src/fsfw_hal/linux/gpio/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/gpio/CMakeLists.txt rename to hal/src/fsfw_hal/linux/gpio/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/gpio/LinuxLibgpioIF.cpp b/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp similarity index 98% rename from hal/src/fsfw/hal/linux/gpio/LinuxLibgpioIF.cpp rename to hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp index 98e027964..eef61e582 100644 --- a/hal/src/fsfw/hal/linux/gpio/LinuxLibgpioIF.cpp +++ b/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.cpp @@ -1,6 +1,6 @@ -#include "fsfw/hal/linux/gpio/LinuxLibgpioIF.h" -#include "fsfw/hal/common/gpio/gpioDefinitions.h" -#include "fsfw/hal/common/gpio/GpioCookie.h" +#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h" +#include "fsfw_hal/common/gpio/gpioDefinitions.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" #include diff --git a/hal/src/fsfw/hal/linux/gpio/LinuxLibgpioIF.h b/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h similarity index 100% rename from hal/src/fsfw/hal/linux/gpio/LinuxLibgpioIF.h rename to hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h diff --git a/hal/src/fsfw/hal/linux/i2c/CMakeLists.txt b/hal/src/fsfw_hal/linux/i2c/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/i2c/CMakeLists.txt rename to hal/src/fsfw_hal/linux/i2c/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/i2c/I2cComIF.cpp b/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp similarity index 98% rename from hal/src/fsfw/hal/linux/i2c/I2cComIF.cpp rename to hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp index d756e75ea..98d9a5107 100644 --- a/hal/src/fsfw/hal/linux/i2c/I2cComIF.cpp +++ b/hal/src/fsfw_hal/linux/i2c/I2cComIF.cpp @@ -1,6 +1,6 @@ -#include "fsfw/hal/linux/i2c/I2cComIF.h" -#include "fsfw/hal/linux/utility.h" -#include "fsfw/hal/linux/UnixFileGuard.h" +#include "fsfw_hal/linux/i2c/I2cComIF.h" +#include "fsfw_hal/linux/utility.h" +#include "fsfw_hal/linux/UnixFileGuard.h" #include "fsfw/serviceinterface/ServiceInterface.h" diff --git a/hal/src/fsfw/hal/linux/i2c/I2cComIF.h b/hal/src/fsfw_hal/linux/i2c/I2cComIF.h similarity index 100% rename from hal/src/fsfw/hal/linux/i2c/I2cComIF.h rename to hal/src/fsfw_hal/linux/i2c/I2cComIF.h diff --git a/hal/src/fsfw/hal/linux/i2c/I2cCookie.cpp b/hal/src/fsfw_hal/linux/i2c/I2cCookie.cpp similarity index 90% rename from hal/src/fsfw/hal/linux/i2c/I2cCookie.cpp rename to hal/src/fsfw_hal/linux/i2c/I2cCookie.cpp index fd0f654d7..aebffedba 100644 --- a/hal/src/fsfw/hal/linux/i2c/I2cCookie.cpp +++ b/hal/src/fsfw_hal/linux/i2c/I2cCookie.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/linux/i2c/I2cCookie.h" +#include "fsfw_hal/linux/i2c/I2cCookie.h" I2cCookie::I2cCookie(address_t i2cAddress_, size_t maxReplyLen_, std::string deviceFile_) : diff --git a/hal/src/fsfw/hal/linux/i2c/I2cCookie.h b/hal/src/fsfw_hal/linux/i2c/I2cCookie.h similarity index 100% rename from hal/src/fsfw/hal/linux/i2c/I2cCookie.h rename to hal/src/fsfw_hal/linux/i2c/I2cCookie.h diff --git a/hal/src/fsfw/hal/linux/rpi/CMakeLists.txt b/hal/src/fsfw_hal/linux/rpi/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/rpi/CMakeLists.txt rename to hal/src/fsfw_hal/linux/rpi/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/rpi/GpioRPi.cpp b/hal/src/fsfw_hal/linux/rpi/GpioRPi.cpp similarity index 93% rename from hal/src/fsfw/hal/linux/rpi/GpioRPi.cpp rename to hal/src/fsfw_hal/linux/rpi/GpioRPi.cpp index 277a9fb2b..6a71f291c 100644 --- a/hal/src/fsfw/hal/linux/rpi/GpioRPi.cpp +++ b/hal/src/fsfw_hal/linux/rpi/GpioRPi.cpp @@ -1,7 +1,7 @@ #include "fsfw/FSFW.h" -#include "fsfw/hal/linux/rpi/GpioRPi.h" -#include "fsfw/hal/common/gpio/GpioCookie.h" +#include "fsfw_hal/linux/rpi/GpioRPi.h" +#include "fsfw_hal/common/gpio/GpioCookie.h" #include diff --git a/hal/src/fsfw/hal/linux/rpi/GpioRPi.h b/hal/src/fsfw_hal/linux/rpi/GpioRPi.h similarity index 100% rename from hal/src/fsfw/hal/linux/rpi/GpioRPi.h rename to hal/src/fsfw_hal/linux/rpi/GpioRPi.h diff --git a/hal/src/fsfw/hal/linux/spi/CMakeLists.txt b/hal/src/fsfw_hal/linux/spi/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/spi/CMakeLists.txt rename to hal/src/fsfw_hal/linux/spi/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/spi/SpiComIF.cpp b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp similarity index 98% rename from hal/src/fsfw/hal/linux/spi/SpiComIF.cpp rename to hal/src/fsfw_hal/linux/spi/SpiComIF.cpp index 8510f9296..fafe67bee 100644 --- a/hal/src/fsfw/hal/linux/spi/SpiComIF.cpp +++ b/hal/src/fsfw_hal/linux/spi/SpiComIF.cpp @@ -1,8 +1,8 @@ #include "fsfw/FSFW.h" -#include "fsfw/hal/linux/spi/SpiComIF.h" -#include "fsfw/hal/linux/spi/SpiCookie.h" -#include "fsfw/hal/linux/utility.h" -#include "fsfw/hal/linux/UnixFileGuard.h" +#include "fsfw_hal/linux/spi/SpiComIF.h" +#include "fsfw_hal/linux/spi/SpiCookie.h" +#include "fsfw_hal/linux/utility.h" +#include "fsfw_hal/linux/UnixFileGuard.h" #include #include diff --git a/hal/src/fsfw/hal/linux/spi/SpiComIF.h b/hal/src/fsfw_hal/linux/spi/SpiComIF.h similarity index 98% rename from hal/src/fsfw/hal/linux/spi/SpiComIF.h rename to hal/src/fsfw_hal/linux/spi/SpiComIF.h index 7f66b8e50..d43e25054 100644 --- a/hal/src/fsfw/hal/linux/spi/SpiComIF.h +++ b/hal/src/fsfw_hal/linux/spi/SpiComIF.h @@ -3,7 +3,7 @@ #include "spiDefinitions.h" #include "returnvalues/classIds.h" -#include "fsfw/hal/common/gpio/GpioIF.h" +#include "fsfw_hal/common/gpio/GpioIF.h" #include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "fsfw/objectmanager/SystemObject.h" diff --git a/hal/src/fsfw/hal/linux/spi/SpiCookie.cpp b/hal/src/fsfw_hal/linux/spi/SpiCookie.cpp similarity index 99% rename from hal/src/fsfw/hal/linux/spi/SpiCookie.cpp rename to hal/src/fsfw_hal/linux/spi/SpiCookie.cpp index a74bc419e..54d8aa161 100644 --- a/hal/src/fsfw/hal/linux/spi/SpiCookie.cpp +++ b/hal/src/fsfw_hal/linux/spi/SpiCookie.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/linux/spi/SpiCookie.h" +#include "fsfw_hal/linux/spi/SpiCookie.h" SpiCookie::SpiCookie(address_t spiAddress, gpioId_t chipSelect, std::string spiDev, const size_t maxSize, spi::SpiModes spiMode, uint32_t spiSpeed): diff --git a/hal/src/fsfw/hal/linux/spi/SpiCookie.h b/hal/src/fsfw_hal/linux/spi/SpiCookie.h similarity index 100% rename from hal/src/fsfw/hal/linux/spi/SpiCookie.h rename to hal/src/fsfw_hal/linux/spi/SpiCookie.h diff --git a/hal/src/fsfw/hal/linux/spi/spiDefinitions.h b/hal/src/fsfw_hal/linux/spi/spiDefinitions.h similarity index 100% rename from hal/src/fsfw/hal/linux/spi/spiDefinitions.h rename to hal/src/fsfw_hal/linux/spi/spiDefinitions.h diff --git a/hal/src/fsfw/hal/linux/uart/CMakeLists.txt b/hal/src/fsfw_hal/linux/uart/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/linux/uart/CMakeLists.txt rename to hal/src/fsfw_hal/linux/uart/CMakeLists.txt diff --git a/hal/src/fsfw/hal/linux/uart/UartComIF.cpp b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp similarity index 99% rename from hal/src/fsfw/hal/linux/uart/UartComIF.cpp rename to hal/src/fsfw_hal/linux/uart/UartComIF.cpp index e543f60e1..3c9757356 100644 --- a/hal/src/fsfw/hal/linux/uart/UartComIF.cpp +++ b/hal/src/fsfw_hal/linux/uart/UartComIF.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/linux/uart/UartComIF.h" +#include "fsfw_hal/linux/uart/UartComIF.h" #include "OBSWConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" diff --git a/hal/src/fsfw/hal/linux/uart/UartComIF.h b/hal/src/fsfw_hal/linux/uart/UartComIF.h similarity index 100% rename from hal/src/fsfw/hal/linux/uart/UartComIF.h rename to hal/src/fsfw_hal/linux/uart/UartComIF.h diff --git a/hal/src/fsfw/hal/linux/uart/UartCookie.cpp b/hal/src/fsfw_hal/linux/uart/UartCookie.cpp similarity index 97% rename from hal/src/fsfw/hal/linux/uart/UartCookie.cpp rename to hal/src/fsfw_hal/linux/uart/UartCookie.cpp index bfd091a8c..339c74511 100644 --- a/hal/src/fsfw/hal/linux/uart/UartCookie.cpp +++ b/hal/src/fsfw_hal/linux/uart/UartCookie.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/linux/uart/UartCookie.h" +#include "fsfw_hal/linux/uart/UartCookie.h" #include diff --git a/hal/src/fsfw/hal/linux/uart/UartCookie.h b/hal/src/fsfw_hal/linux/uart/UartCookie.h similarity index 100% rename from hal/src/fsfw/hal/linux/uart/UartCookie.h rename to hal/src/fsfw_hal/linux/uart/UartCookie.h diff --git a/hal/src/fsfw/hal/linux/utility.cpp b/hal/src/fsfw_hal/linux/utility.cpp similarity index 95% rename from hal/src/fsfw/hal/linux/utility.cpp rename to hal/src/fsfw_hal/linux/utility.cpp index 04fded6c6..99489e3f7 100644 --- a/hal/src/fsfw/hal/linux/utility.cpp +++ b/hal/src/fsfw_hal/linux/utility.cpp @@ -1,6 +1,6 @@ #include "fsfw/FSFW.h" #include "fsfw/serviceinterface/ServiceInterface.h" -#include "fsfw/hal/linux/utility.h" +#include "fsfw_hal/linux/utility.h" #include #include diff --git a/hal/src/fsfw/hal/linux/utility.h b/hal/src/fsfw_hal/linux/utility.h similarity index 100% rename from hal/src/fsfw/hal/linux/utility.h rename to hal/src/fsfw_hal/linux/utility.h diff --git a/hal/src/fsfw/hal/stm32h7/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/CMakeLists.txt diff --git a/hal/src/fsfw/hal/stm32h7/devicetest/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/devicetest/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/devicetest/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/devicetest/CMakeLists.txt diff --git a/hal/src/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.cpp b/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp similarity index 98% rename from hal/src/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.cpp rename to hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp index 04b1de3bc..051be3449 100644 --- a/hal/src/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.cpp +++ b/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.cpp @@ -1,10 +1,10 @@ -#include "fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h" +#include "fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h" -#include "fsfw/hal/stm32h7/spi/mspInit.h" -#include "fsfw/hal/stm32h7/spi/spiDefinitions.h" -#include "fsfw/hal/stm32h7/spi/spiCore.h" -#include "fsfw/hal/stm32h7/spi/spiInterrupts.h" -#include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h" +#include "fsfw_hal/stm32h7/spi/mspInit.h" +#include "fsfw_hal/stm32h7/spi/spiDefinitions.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" +#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h" #include "fsfw/tasks/TaskFactory.h" #include "fsfw/serviceinterface/ServiceInterface.h" diff --git a/hal/src/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h b/hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h rename to hal/src/fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h diff --git a/hal/src/fsfw/hal/stm32h7/dma.cpp b/hal/src/fsfw_hal/stm32h7/dma.cpp similarity index 98% rename from hal/src/fsfw/hal/stm32h7/dma.cpp rename to hal/src/fsfw_hal/stm32h7/dma.cpp index 288e42944..bedf4aa49 100644 --- a/hal/src/fsfw/hal/stm32h7/dma.cpp +++ b/hal/src/fsfw_hal/stm32h7/dma.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/hal/src/fsfw/hal/stm32h7/dma.h b/hal/src/fsfw_hal/stm32h7/dma.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/dma.h rename to hal/src/fsfw_hal/stm32h7/dma.h diff --git a/hal/src/fsfw/hal/stm32h7/gpio/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/gpio/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/gpio/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/gpio/CMakeLists.txt diff --git a/hal/src/fsfw/hal/stm32h7/gpio/gpio.cpp b/hal/src/fsfw_hal/stm32h7/gpio/gpio.cpp similarity index 96% rename from hal/src/fsfw/hal/stm32h7/gpio/gpio.cpp rename to hal/src/fsfw_hal/stm32h7/gpio/gpio.cpp index 927588a37..5a890d7f9 100644 --- a/hal/src/fsfw/hal/stm32h7/gpio/gpio.cpp +++ b/hal/src/fsfw_hal/stm32h7/gpio/gpio.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/stm32h7/gpio/gpio.h" +#include "fsfw_hal/stm32h7/gpio/gpio.h" #include "stm32h7xx_hal_rcc.h" diff --git a/hal/src/fsfw/hal/stm32h7/gpio/gpio.h b/hal/src/fsfw_hal/stm32h7/gpio/gpio.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/gpio/gpio.h rename to hal/src/fsfw_hal/stm32h7/gpio/gpio.h diff --git a/hal/src/fsfw/hal/stm32h7/i2c/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/i2c/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/i2c/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/i2c/CMakeLists.txt diff --git a/hal/src/fsfw/hal/stm32h7/interrupts.h b/hal/src/fsfw_hal/stm32h7/interrupts.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/interrupts.h rename to hal/src/fsfw_hal/stm32h7/interrupts.h diff --git a/hal/src/fsfw/hal/stm32h7/spi/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/spi/CMakeLists.txt diff --git a/hal/src/fsfw/hal/stm32h7/spi/SpiComIF.cpp b/hal/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp similarity index 98% rename from hal/src/fsfw/hal/stm32h7/spi/SpiComIF.cpp rename to hal/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp index da34c4c0c..1813aac02 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/SpiComIF.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/SpiComIF.cpp @@ -1,11 +1,11 @@ -#include "fsfw/hal/stm32h7/spi/SpiComIF.h" -#include "fsfw/hal/stm32h7/spi/SpiCookie.h" +#include "fsfw_hal/stm32h7/spi/SpiComIF.h" +#include "fsfw_hal/stm32h7/spi/SpiCookie.h" #include "fsfw/tasks/SemaphoreFactory.h" -#include "fsfw/hal/stm32h7/spi/spiCore.h" -#include "fsfw/hal/stm32h7/spi/spiInterrupts.h" -#include "fsfw/hal/stm32h7/spi/mspInit.h" -#include "fsfw/hal/stm32h7/gpio/gpio.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" +#include "fsfw_hal/stm32h7/spi/mspInit.h" +#include "fsfw_hal/stm32h7/gpio/gpio.h" // FreeRTOS required special Semaphore handling from an ISR. Therefore, we use the concrete // instance here, because RTEMS and FreeRTOS are the only relevant OSALs currently diff --git a/hal/src/fsfw/hal/stm32h7/spi/SpiComIF.h b/hal/src/fsfw_hal/stm32h7/spi/SpiComIF.h similarity index 99% rename from hal/src/fsfw/hal/stm32h7/spi/SpiComIF.h rename to hal/src/fsfw_hal/stm32h7/spi/SpiComIF.h index 00625b34d..9548e102a 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/SpiComIF.h +++ b/hal/src/fsfw_hal/stm32h7/spi/SpiComIF.h @@ -5,7 +5,7 @@ #include "fsfw/devicehandlers/DeviceCommunicationIF.h" #include "fsfw/objectmanager/SystemObject.h" -#include "fsfw/hal/stm32h7/spi/spiDefinitions.h" +#include "fsfw_hal/stm32h7/spi/spiDefinitions.h" #include "stm32h7xx_hal_spi.h" #include "stm32h743xx.h" diff --git a/hal/src/fsfw/hal/stm32h7/spi/SpiCookie.cpp b/hal/src/fsfw_hal/stm32h7/spi/SpiCookie.cpp similarity index 98% rename from hal/src/fsfw/hal/stm32h7/spi/SpiCookie.cpp rename to hal/src/fsfw_hal/stm32h7/spi/SpiCookie.cpp index 82d705c21..88f1e1f14 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/SpiCookie.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/SpiCookie.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/stm32h7/spi/SpiCookie.h" +#include "fsfw_hal/stm32h7/spi/SpiCookie.h" SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode, diff --git a/hal/src/fsfw/hal/stm32h7/spi/SpiCookie.h b/hal/src/fsfw_hal/stm32h7/spi/SpiCookie.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/SpiCookie.h rename to hal/src/fsfw_hal/stm32h7/spi/SpiCookie.h diff --git a/hal/src/fsfw/hal/stm32h7/spi/mspInit.cpp b/hal/src/fsfw_hal/stm32h7/spi/mspInit.cpp similarity index 98% rename from hal/src/fsfw/hal/stm32h7/spi/mspInit.cpp rename to hal/src/fsfw_hal/stm32h7/spi/mspInit.cpp index 424a8bfb9..4df61f9b8 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/mspInit.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/mspInit.cpp @@ -1,7 +1,7 @@ -#include "fsfw/hal/stm32h7/dma.h" -#include "fsfw/hal/stm32h7/spi/mspInit.h" -#include "fsfw/hal/stm32h7/spi/spiCore.h" -#include "fsfw/hal/stm32h7/spi/spiInterrupts.h" +#include "fsfw_hal/stm32h7/dma.h" +#include "fsfw_hal/stm32h7/spi/mspInit.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" #include "stm32h743xx.h" #include "stm32h7xx_hal_spi.h" diff --git a/hal/src/fsfw/hal/stm32h7/spi/mspInit.h b/hal/src/fsfw_hal/stm32h7/spi/mspInit.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/mspInit.h rename to hal/src/fsfw_hal/stm32h7/spi/mspInit.h diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiCore.cpp b/hal/src/fsfw_hal/stm32h7/spi/spiCore.cpp similarity index 99% rename from hal/src/fsfw/hal/stm32h7/spi/spiCore.cpp rename to hal/src/fsfw_hal/stm32h7/spi/spiCore.cpp index a72bf12b6..e569c9f46 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/spiCore.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/spiCore.cpp @@ -1,5 +1,5 @@ -#include "fsfw/hal/stm32h7/spi/spiCore.h" -#include "fsfw/hal/stm32h7/spi/spiDefinitions.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiDefinitions.h" #include diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiCore.h b/hal/src/fsfw_hal/stm32h7/spi/spiCore.h similarity index 94% rename from hal/src/fsfw/hal/stm32h7/spi/spiCore.h rename to hal/src/fsfw_hal/stm32h7/spi/spiCore.h index bff90a5b0..1ad5c6935 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/spiCore.h +++ b/hal/src/fsfw_hal/stm32h7/spi/spiCore.h @@ -1,8 +1,8 @@ #ifndef FSFW_HAL_STM32H7_SPI_SPICORE_H_ #define FSFW_HAL_STM32H7_SPI_SPICORE_H_ -#include "fsfw/hal/stm32h7/dma.h" -#include "fsfw/hal/stm32h7/spi/spiDefinitions.h" +#include "fsfw_hal/stm32h7/dma.h" +#include "fsfw_hal/stm32h7/spi/spiDefinitions.h" #include "stm32h7xx_hal.h" #include "stm32h7xx_hal_dma.h" diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiDefinitions.cpp b/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.cpp similarity index 96% rename from hal/src/fsfw/hal/stm32h7/spi/spiDefinitions.cpp rename to hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.cpp index 6a83ae42b..11655f5ec 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/spiDefinitions.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.cpp @@ -1,4 +1,4 @@ -#include "fsfw/hal/stm32h7/spi/spiDefinitions.h" +#include "fsfw_hal/stm32h7/spi/spiDefinitions.h" void spi::assignSpiMode(SpiModes spiMode, SPI_HandleTypeDef& spiHandle) { switch(spiMode) { diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiDefinitions.h b/hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/spiDefinitions.h rename to hal/src/fsfw_hal/stm32h7/spi/spiDefinitions.h diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiInterrupts.cpp b/hal/src/fsfw_hal/stm32h7/spi/spiInterrupts.cpp similarity index 96% rename from hal/src/fsfw/hal/stm32h7/spi/spiInterrupts.cpp rename to hal/src/fsfw_hal/stm32h7/spi/spiInterrupts.cpp index 90cfe7065..5d84208d9 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/spiInterrupts.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/spiInterrupts.cpp @@ -1,5 +1,5 @@ -#include "fsfw/hal/stm32h7/spi/spiInterrupts.h" -#include "fsfw/hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" #include "stm32h7xx_hal.h" #include "stm32h7xx_hal_dma.h" diff --git a/hal/src/fsfw/hal/stm32h7/spi/spiInterrupts.h b/hal/src/fsfw_hal/stm32h7/spi/spiInterrupts.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/spiInterrupts.h rename to hal/src/fsfw_hal/stm32h7/spi/spiInterrupts.h diff --git a/hal/src/fsfw/hal/stm32h7/spi/stm32h743ziSpi.cpp b/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp similarity index 95% rename from hal/src/fsfw/hal/stm32h7/spi/stm32h743ziSpi.cpp rename to hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp index f1f2815ef..43194704f 100644 --- a/hal/src/fsfw/hal/stm32h7/spi/stm32h743ziSpi.cpp +++ b/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.cpp @@ -1,6 +1,6 @@ -#include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h" -#include "fsfw/hal/stm32h7/spi/spiCore.h" -#include "fsfw/hal/stm32h7/spi/spiInterrupts.h" +#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h" +#include "fsfw_hal/stm32h7/spi/spiCore.h" +#include "fsfw_hal/stm32h7/spi/spiInterrupts.h" #include "stm32h7xx_hal.h" #include "stm32h7xx_hal_rcc.h" diff --git a/hal/src/fsfw/hal/stm32h7/spi/stm32h743ziSpi.h b/hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.h similarity index 100% rename from hal/src/fsfw/hal/stm32h7/spi/stm32h743ziSpi.h rename to hal/src/fsfw_hal/stm32h7/spi/stm32h743ziSpi.h diff --git a/hal/src/fsfw/hal/stm32h7/uart/CMakeLists.txt b/hal/src/fsfw_hal/stm32h7/uart/CMakeLists.txt similarity index 100% rename from hal/src/fsfw/hal/stm32h7/uart/CMakeLists.txt rename to hal/src/fsfw_hal/stm32h7/uart/CMakeLists.txt diff --git a/misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp b/misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp index 428adf1d7..08ad41ec3 100644 --- a/misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp +++ b/misc/defaultcfg/fsfwconfig/objects/FsfwFactory.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/fsfw/FSFW.h.in b/src/fsfw/FSFW.h.in index 9b74d04c8..4d4b8aee1 100644 --- a/src/fsfw/FSFW.h.in +++ b/src/fsfw/FSFW.h.in @@ -9,5 +9,10 @@ #cmakedefine FSFW_ADD_COORDINATES #cmakedefine FSFW_ADD_PUS #cmakedefine FSFW_ADD_MONITORING +#cmakedefine FSFW_ADD_SGP4_PROPAGATOR + +#ifndef FSFW_HAL_L3GD20_GYRO_DEBUG +#define FSFW_HAL_L3GD20_GYRO_DEBUG 0 +#endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */ #endif /* FSFW_FSFW_H_ */ diff --git a/src/fsfw/action/ActionHelper.cpp b/src/fsfw/action/ActionHelper.cpp index 3dfe8b50f..3e9d121ac 100644 --- a/src/fsfw/action/ActionHelper.cpp +++ b/src/fsfw/action/ActionHelper.cpp @@ -55,7 +55,19 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) { void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId, store_address_t dataAddress) { - const uint8_t* dataPtr = NULL; + if(ipcStore == nullptr) { +#if FSFW_VERBOSE_LEVEL >= 1 +#if FSFW_CPP_OSTREAM_ENABLED == 1 + sif::warning << "ActionHelper::prepareExecution: IPC Store not set. Call initialize first" + << std::endl; +#else + sif::printWarning("ActionHelper::prepareExecution: " + "IPC Store not set. Call initialize first\n"); +#endif +#endif /* FSFW_VERBOSE_LEVEL >= 1 */ + return; + } + const uint8_t* dataPtr = nullptr; size_t size = 0; ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size); if (result != HasReturnvaluesIF::RETURN_OK) { diff --git a/src/fsfw/coordinates/Sgp4Propagator.h b/src/fsfw/coordinates/Sgp4Propagator.h index 4f29509fb..7c7a0a8c9 100644 --- a/src/fsfw/coordinates/Sgp4Propagator.h +++ b/src/fsfw/coordinates/Sgp4Propagator.h @@ -7,7 +7,7 @@ #ifndef PLATFORM_WIN #include #endif -#include "fsfw/contrib/sgp4/sgp4unit.h" +#include "fsfw_contrib/sgp4/sgp4unit.h" #include "fsfw/returnvalues/HasReturnvaluesIF.h" class Sgp4Propagator { diff --git a/src/fsfw/coordinates/coordinatesConf.h b/src/fsfw/coordinates/coordinatesConf.h index ce798e6f1..9c1c37549 100644 --- a/src/fsfw/coordinates/coordinatesConf.h +++ b/src/fsfw/coordinates/coordinatesConf.h @@ -8,4 +8,9 @@ not enabled with FSFW_ADD_COORDINATES #endif +#ifndef FSFW_ADD_SGP4_PROPAGATOR +#warning Coordinates files were included but SGP4 contributed code compilation was \ + not enabled with FSFW_ADD_SGP4_PROPAGATOR +#endif + #endif /* FSFW_SRC_FSFW_COORDINATES_COORDINATESCONF_H_ */ diff --git a/src/fsfw/events/EventManager.cpp b/src/fsfw/events/EventManager.cpp index 5aa82434d..958076a9b 100644 --- a/src/fsfw/events/EventManager.cpp +++ b/src/fsfw/events/EventManager.cpp @@ -12,119 +12,119 @@ MessageQueueId_t EventManagerIF::eventmanagerQueue = MessageQueueIF::NO_QUEUE; // So a good guess is 75 to a max of 100 pools required for each, which fits well. const LocalPool::LocalPoolConfig EventManager::poolConfig = { {fsfwconfig::FSFW_EVENTMGMR_MATCHTREE_NODES, - sizeof(EventMatchTree::Node)}, + sizeof(EventMatchTree::Node)}, {fsfwconfig::FSFW_EVENTMGMT_EVENTIDMATCHERS, - sizeof(EventIdRangeMatcher)}, + sizeof(EventIdRangeMatcher)}, {fsfwconfig::FSFW_EVENTMGMR_RANGEMATCHERS, - sizeof(ReporterRangeMatcher)} + sizeof(ReporterRangeMatcher)} }; EventManager::EventManager(object_id_t setObjectId) : - SystemObject(setObjectId), - factoryBackend(0, poolConfig, false, true) { - mutex = MutexFactory::instance()->createMutex(); - eventReportQueue = QueueFactory::instance()->createMessageQueue( - MAX_EVENTS_PER_CYCLE, EventMessage::EVENT_MESSAGE_SIZE); + SystemObject(setObjectId), + factoryBackend(0, poolConfig, false, true) { + mutex = MutexFactory::instance()->createMutex(); + eventReportQueue = QueueFactory::instance()->createMessageQueue( + MAX_EVENTS_PER_CYCLE, EventMessage::EVENT_MESSAGE_SIZE); } EventManager::~EventManager() { - QueueFactory::instance()->deleteMessageQueue(eventReportQueue); - MutexFactory::instance()->deleteMutex(mutex); + QueueFactory::instance()->deleteMessageQueue(eventReportQueue); + MutexFactory::instance()->deleteMutex(mutex); } MessageQueueId_t EventManager::getEventReportQueue() { - return eventReportQueue->getId(); + return eventReportQueue->getId(); } ReturnValue_t EventManager::performOperation(uint8_t opCode) { - ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; - while (result == HasReturnvaluesIF::RETURN_OK) { - EventMessage message; - result = eventReportQueue->receiveMessage(&message); - if (result == HasReturnvaluesIF::RETURN_OK) { + ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; + while (result == HasReturnvaluesIF::RETURN_OK) { + EventMessage message; + result = eventReportQueue->receiveMessage(&message); + if (result == HasReturnvaluesIF::RETURN_OK) { #if FSFW_OBJ_EVENT_TRANSLATION == 1 - printEvent(&message); + printEvent(&message); #endif - notifyListeners(&message); - } - } - return HasReturnvaluesIF::RETURN_OK; + notifyListeners(&message); + } + } + return HasReturnvaluesIF::RETURN_OK; } void EventManager::notifyListeners(EventMessage* message) { - lockMutex(); - for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) { - if (iter->second.match(message)) { - MessageQueueSenderIF::sendMessage(iter->first, message, - message->getSender()); - } - } - unlockMutex(); + lockMutex(); + for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) { + if (iter->second.match(message)) { + MessageQueueSenderIF::sendMessage(iter->first, message, + message->getSender()); + } + } + unlockMutex(); } ReturnValue_t EventManager::registerListener(MessageQueueId_t listener, bool forwardAllButSelected) { - auto result = listenerList.insert( - std::pair(listener, - EventMatchTree(&factoryBackend, forwardAllButSelected))); - if (!result.second) { - return HasReturnvaluesIF::RETURN_FAILED; - } - return HasReturnvaluesIF::RETURN_OK; + auto result = listenerList.insert( + std::pair(listener, + EventMatchTree(&factoryBackend, forwardAllButSelected))); + if (!result.second) { + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; } ReturnValue_t EventManager::subscribeToEvent(MessageQueueId_t listener, - EventId_t event) { - return subscribeToEventRange(listener, event); + EventId_t event) { + return subscribeToEventRange(listener, event); } ReturnValue_t EventManager::subscribeToAllEventsFrom(MessageQueueId_t listener, - object_id_t object) { - return subscribeToEventRange(listener, 0, 0, true, object); + object_id_t object) { + return subscribeToEventRange(listener, 0, 0, true, object); } ReturnValue_t EventManager::subscribeToEventRange(MessageQueueId_t listener, - EventId_t idFrom, EventId_t idTo, bool idInverted, - object_id_t reporterFrom, object_id_t reporterTo, - bool reporterInverted) { - auto iter = listenerList.find(listener); - if (iter == listenerList.end()) { - return LISTENER_NOT_FOUND; - } - lockMutex(); - ReturnValue_t result = iter->second.addMatch(idFrom, idTo, idInverted, - reporterFrom, reporterTo, reporterInverted); - unlockMutex(); - return result; + EventId_t idFrom, EventId_t idTo, bool idInverted, + object_id_t reporterFrom, object_id_t reporterTo, + bool reporterInverted) { + auto iter = listenerList.find(listener); + if (iter == listenerList.end()) { + return LISTENER_NOT_FOUND; + } + lockMutex(); + ReturnValue_t result = iter->second.addMatch(idFrom, idTo, idInverted, + reporterFrom, reporterTo, reporterInverted); + unlockMutex(); + return result; } ReturnValue_t EventManager::unsubscribeFromEventRange(MessageQueueId_t listener, - EventId_t idFrom, EventId_t idTo, bool idInverted, - object_id_t reporterFrom, object_id_t reporterTo, - bool reporterInverted) { - auto iter = listenerList.find(listener); - if (iter == listenerList.end()) { - return LISTENER_NOT_FOUND; - } - lockMutex(); - ReturnValue_t result = iter->second.removeMatch(idFrom, idTo, idInverted, - reporterFrom, reporterTo, reporterInverted); - unlockMutex(); - return result; + EventId_t idFrom, EventId_t idTo, bool idInverted, + object_id_t reporterFrom, object_id_t reporterTo, + bool reporterInverted) { + auto iter = listenerList.find(listener); + if (iter == listenerList.end()) { + return LISTENER_NOT_FOUND; + } + lockMutex(); + ReturnValue_t result = iter->second.removeMatch(idFrom, idTo, idInverted, + reporterFrom, reporterTo, reporterInverted); + unlockMutex(); + return result; } void EventManager::lockMutex() { - mutex->lockMutex(timeoutType, timeoutMs); + mutex->lockMutex(timeoutType, timeoutMs); } void EventManager::unlockMutex() { - mutex->unlockMutex(); + mutex->unlockMutex(); } void EventManager::setMutexTimeout(MutexIF::TimeoutType timeoutType, - uint32_t timeoutMs) { - this->timeoutType = timeoutType; - this->timeoutMs = timeoutMs; + uint32_t timeoutMs) { + this->timeoutType = timeoutType; + this->timeoutMs = timeoutMs; } #if FSFW_OBJ_EVENT_TRANSLATION == 1 @@ -157,7 +157,7 @@ void EventManager::printUtility(sif::OutputTypes printType, EventMessage *messag message->getReporter() << std::setfill(' ') << std::dec; } sif::info << " reported event with ID " << message->getEventId() << std::endl; - sif::debug << translateEvents(message->getEvent()) << " | " <getEvent()) << " | " <getParameter1() << " | P1 Dec: " << std::dec << message->getParameter1() << std::hex << " | P2 Hex: 0x" << message->getParameter2() << " | P2 Dec: " << std::dec << message->getParameter2() << std::endl; @@ -170,9 +170,10 @@ void EventManager::printUtility(sif::OutputTypes printType, EventMessage *messag sif::printInfo("Event Manager: Reporter ID 0x%08x reported event with ID %d\n", message->getReporter(), message->getEventId()); } - sif::printInfo("P1 Hex: 0x%x | P1 Dec: %d | P2 Hex: 0x%x | P2 Dec: %d\n", - message->getParameter1(), message->getParameter1(), - message->getParameter2(), message->getParameter2()); + + sif::printInfo("%s | P1 Hex: 0x%x | P1 Dec: %d | P2 Hex: 0x%x | P2 Dec: %d\n", + translateEvents(message->getEvent()), message->getParameter1(), + message->getParameter1(), message->getParameter2(), message->getParameter2()); #endif /* FSFW_CPP_OSTREAM_ENABLED == 0 */ } else { diff --git a/src/fsfw/osal/freertos/MessageQueue.h b/src/fsfw/osal/freertos/MessageQueue.h index ba8352118..debb30348 100644 --- a/src/fsfw/osal/freertos/MessageQueue.h +++ b/src/fsfw/osal/freertos/MessageQueue.h @@ -11,7 +11,6 @@ #include "FreeRTOS.h" #include "queue.h" - /** * @brief This class manages sending and receiving of * message queue messages. diff --git a/src/fsfw/osal/linux/CMakeLists.txt b/src/fsfw/osal/linux/CMakeLists.txt index 0fb66b3ed..fa2e8aa05 100644 --- a/src/fsfw/osal/linux/CMakeLists.txt +++ b/src/fsfw/osal/linux/CMakeLists.txt @@ -16,6 +16,7 @@ target_sources(${LIB_FSFW_NAME} Timer.cpp tcpipHelpers.cpp unixUtility.cpp + CommandExecutor.cpp ) find_package(Threads REQUIRED) diff --git a/src/fsfw/osal/linux/CommandExecutor.cpp b/src/fsfw/osal/linux/CommandExecutor.cpp new file mode 100644 index 000000000..cd05a553f --- /dev/null +++ b/src/fsfw/osal/linux/CommandExecutor.cpp @@ -0,0 +1,184 @@ +#include "CommandExecutor.h" + +#include "fsfw/serviceinterface.h" +#include "fsfw/container/SimpleRingBuffer.h" +#include "fsfw/container/DynamicFIFO.h" + +#include + +#include + +CommandExecutor::CommandExecutor(const size_t maxSize): +readVec(maxSize) { + waiter.events = POLLIN; +} + +ReturnValue_t CommandExecutor::load(std::string command, bool blocking, bool printOutput) { + if(state == States::PENDING) { + return COMMAND_PENDING; + } + + currentCmd = command; + this->blocking = blocking; + this->printOutput = printOutput; + if(state == States::IDLE) { + state = States::COMMAND_LOADED; + } + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t CommandExecutor::execute() { + if(state == States::IDLE) { + return NO_COMMAND_LOADED_OR_PENDING; + } + else if(state == States::PENDING) { + return COMMAND_PENDING; + } + currentCmdFile = popen(currentCmd.c_str(), "r"); + if(currentCmdFile == nullptr) { + lastError = errno; + return HasReturnvaluesIF::RETURN_FAILED; + } + if(blocking) { + return executeBlocking(); + } + else { + currentFd = fileno(currentCmdFile); + waiter.fd = currentFd; + } + return HasReturnvaluesIF::RETURN_OK; +} + +ReturnValue_t CommandExecutor::close() { + if(state == States::PENDING) { + // Attempt to close process, irrespective of if it is running or not + if(currentCmdFile != nullptr) { + pclose(currentCmdFile); + } + } + return HasReturnvaluesIF::RETURN_OK; +} + +void CommandExecutor::printLastError(std::string funcName) const { + if(lastError != 0) { + sif::error << funcName << " pclose failed with code " << + lastError << ": " << strerror(lastError) << std::endl; + } +} + +void CommandExecutor::setRingBuffer(SimpleRingBuffer *ringBuffer, + DynamicFIFO* sizesFifo) { + this->ringBuffer = ringBuffer; + this->sizesFifo = sizesFifo; +} + +ReturnValue_t CommandExecutor::check(bool& bytesRead) { + if(blocking) { + return HasReturnvaluesIF::RETURN_OK; + } + switch(state) { + case(States::IDLE): + case(States::COMMAND_LOADED): { + return NO_COMMAND_LOADED_OR_PENDING; + } + case(States::PENDING): { + break; + } + } + + int result = poll(&waiter, 1, 0); + switch(result) { + case(0): { + return HasReturnvaluesIF::RETURN_OK; + break; + } + case(1): { + if (waiter.revents & POLLIN) { + ssize_t readBytes = read(currentFd, readVec.data(), readVec.size()); + if(readBytes == 0) { + // Should not happen + sif::warning << "CommandExecutor::check: " + "No bytes read after poll event.." << std::endl; + break; + } + else if(readBytes > 0) { + bytesRead = true; + if(printOutput) { + // It is assumed the command output is line terminated + sif::info << currentCmd << " | " << readVec.data(); + } + if(ringBuffer != nullptr) { + ringBuffer->writeData(reinterpret_cast( + readVec.data()), readBytes); + } + if(sizesFifo != nullptr) { + if(not sizesFifo->full()) { + sizesFifo->insert(readBytes); + } + } + return BYTES_READ; + } + else { + // Should also not happen + sif::warning << "CommandExecutor::check: Error " << errno << ": " << + strerror(errno) << std::endl; + } + } + else if(waiter.revents & POLLERR) { + sif::warning << "CommandExecuter::check: Poll error" << std::endl; + return COMMAND_ERROR; + } + else if(waiter.revents & POLLHUP) { + int result = pclose(currentCmdFile); + if(result != 0) { + lastError = result; + return HasReturnvaluesIF::RETURN_FAILED; + } + state = States::IDLE; + currentCmdFile = nullptr; + currentFd = 0; + return EXECUTION_FINISHED; + } + break; + } + } + return HasReturnvaluesIF::RETURN_OK; +} + +void CommandExecutor::reset() { + CommandExecutor::close(); + currentCmdFile = nullptr; + currentFd = 0; + state = States::IDLE; +} + +int CommandExecutor::getLastError() const { + return this->lastError; +} + +CommandExecutor::States CommandExecutor::getCurrentState() const { + return state; +} + +ReturnValue_t CommandExecutor::executeBlocking() { + while(fgets(readVec.data(), readVec.size(), currentCmdFile) != nullptr) { + std::string output(readVec.data()); + if(printOutput) { + sif::info << currentCmd << " | " << output; + } + if(ringBuffer != nullptr) { + ringBuffer->writeData(reinterpret_cast(output.data()), output.size()); + } + if(sizesFifo != nullptr) { + if(not sizesFifo->full()) { + sizesFifo->insert(output.size()); + } + } + } + int result = pclose(currentCmdFile); + if(result != 0) { + lastError = result; + return HasReturnvaluesIF::RETURN_FAILED; + } + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/src/fsfw/osal/linux/CommandExecutor.h b/src/fsfw/osal/linux/CommandExecutor.h new file mode 100644 index 000000000..21876c6f1 --- /dev/null +++ b/src/fsfw/osal/linux/CommandExecutor.h @@ -0,0 +1,134 @@ +#ifndef FSFW_SRC_FSFW_OSAL_LINUX_COMMANDEXECUTOR_H_ +#define FSFW_SRC_FSFW_OSAL_LINUX_COMMANDEXECUTOR_H_ + +#include "fsfw/returnvalues/HasReturnvaluesIF.h" +#include "fsfw/returnvalues/FwClassIds.h" + +#include + +#include +#include + +class SimpleRingBuffer; +template class DynamicFIFO; + +/** + * @brief Helper class to execute shell commands in blocking and non-blocking mode + * @details + * This class is able to execute processes by using the Linux popen call. It also has the + * capability of writing the read output of a process into a provided ring buffer. + * + * The executor works by first loading the command which should be executed and specifying + * whether it should be executed blocking or non-blocking. After that, execution can be started + * with the execute command. In blocking mode, the execute command will block until the command + * has finished + */ +class CommandExecutor { +public: + enum class States { + IDLE, + COMMAND_LOADED, + PENDING + }; + + static constexpr uint8_t CLASS_ID = CLASS_ID::LINUX_OSAL; + + //! [EXPORT] : [COMMENT] Execution of the current command has finished + static constexpr ReturnValue_t EXECUTION_FINISHED = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 0); + + //! [EXPORT] : [COMMENT] Command is pending. This will also be returned if the user tries + //! to load another command but a command is still pending + static constexpr ReturnValue_t COMMAND_PENDING = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 1); + //! [EXPORT] : [COMMENT] Some bytes have been read from the executing process + static constexpr ReturnValue_t BYTES_READ = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 2); + //! [EXPORT] : [COMMENT] Command execution failed + static constexpr ReturnValue_t COMMAND_ERROR = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3); + //! [EXPORT] : [COMMENT] + static constexpr ReturnValue_t NO_COMMAND_LOADED_OR_PENDING = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 4); + static constexpr ReturnValue_t PCLOSE_CALL_ERROR = + HasReturnvaluesIF::makeReturnCode(CLASS_ID, 6); + + /** + * Constructor. Is initialized with maximum size of internal buffer to read data from the + * executed process. + * @param maxSize + */ + CommandExecutor(const size_t maxSize); + + /** + * Load a new command which should be executed + * @param command + * @param blocking + * @param printOutput + * @return + */ + ReturnValue_t load(std::string command, bool blocking, bool printOutput = true); + /** + * Execute the loaded command. + * @return + * - In blocking mode, it will return RETURN_FAILED if + * the result of the system call was not 0. The error value can be accessed using + * getLastError + * - In non-blocking mode, this call will start + * the execution and then return RETURN_OK + */ + ReturnValue_t execute(); + /** + * Only used in non-blocking mode. Checks the currently running command. + * @param bytesRead Will be set to the number of bytes read, if bytes have been read + * @return + * - BYTES_READ if bytes have been read from the executing process. It is recommended to call + * check again after this + * - RETURN_OK execution is pending, but no bytes have been read from the executing process + * - RETURN_FAILED if execution has failed, error value can be accessed using getLastError + * - EXECUTION_FINISHED if the process was executed successfully + * - COMMAND_ERROR internal poll error + */ + ReturnValue_t check(bool& bytesRead); + /** + * Abort the current command. Should normally not be necessary, check can be used to find + * out whether command execution was successful + * @return RETURN_OK + */ + ReturnValue_t close(); + + States getCurrentState() const; + int getLastError() const; + void printLastError(std::string funcName) const; + + /** + * Assign a ring buffer and a FIFO which will be filled by the executor with the output + * read from the started process + * @param ringBuffer + * @param sizesFifo + */ + void setRingBuffer(SimpleRingBuffer* ringBuffer, DynamicFIFO* sizesFifo); + + /** + * Reset the executor. This calls close internally and then reset the state machine so new + * commands can be loaded and executed + */ + void reset(); +private: + std::string currentCmd; + bool blocking = true; + FILE* currentCmdFile = nullptr; + int currentFd = 0; + bool printOutput = true; + std::vector readVec; + struct pollfd waiter {}; + SimpleRingBuffer* ringBuffer = nullptr; + DynamicFIFO* sizesFifo = nullptr; + + States state = States::IDLE; + int lastError = 0; + + ReturnValue_t executeBlocking(); +}; + +#endif /* FSFW_SRC_FSFW_OSAL_LINUX_COMMANDEXECUTOR_H_ */ diff --git a/src/fsfw/osal/linux/unixUtility.cpp b/src/fsfw/osal/linux/unixUtility.cpp index 40d8c2129..57e1f17a3 100644 --- a/src/fsfw/osal/linux/unixUtility.cpp +++ b/src/fsfw/osal/linux/unixUtility.cpp @@ -14,7 +14,7 @@ void utility::printUnixErrorGeneric(const char* const className, #if FSFW_VERBOSE_LEVEL >= 1 if(outputType == sif::OutputTypes::OUT_ERROR) { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::error << className << "::" << function << ":" << failString << " error: " + sif::error << className << "::" << function << ": " << failString << " error: " << strerror(errno) << std::endl; #else sif::printError("%s::%s: %s error: %s\n", className, function, failString, strerror(errno)); @@ -22,7 +22,7 @@ void utility::printUnixErrorGeneric(const char* const className, } else { #if FSFW_CPP_OSTREAM_ENABLED == 1 - sif::warning << className << "::" << function << ":" << failString << " error: " + sif::warning << className << "::" << function << ": " << failString << " error: " << strerror(errno) << std::endl; #else sif::printWarning("%s::%s: %s error: %s\n", className, function, failString, strerror(errno)); diff --git a/src/fsfw/returnvalues/FwClassIds.h b/src/fsfw/returnvalues/FwClassIds.h index af32f9a76..7f355c40d 100644 --- a/src/fsfw/returnvalues/FwClassIds.h +++ b/src/fsfw/returnvalues/FwClassIds.h @@ -72,6 +72,7 @@ enum: uint8_t { PUS_SERVICE_3, //PUS3 PUS_SERVICE_9, //PUS9 FILE_SYSTEM, //FILS + LINUX_OSAL, //UXOS HAL_SPI, //HSPI HAL_UART, //HURT HAL_I2C, //HI2C diff --git a/src/fsfw/serviceinterface/ServiceInterface.h b/src/fsfw/serviceinterface/ServiceInterface.h index e95dd9a47..9f05b96cc 100644 --- a/src/fsfw/serviceinterface/ServiceInterface.h +++ b/src/fsfw/serviceinterface/ServiceInterface.h @@ -1,7 +1,7 @@ #ifndef FSFW_SERVICEINTERFACE_SERVICEINTERFACE_H_ #define FSFW_SERVICEINTERFACE_SERVICEINTERFACE_H_ -#include +#include "fsfw/FSFW.h" #include "serviceInterfaceDefintions.h" #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp index 7cba21459..0411e6744 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp +++ b/src/fsfw/serviceinterface/ServiceInterfaceBuffer.cpp @@ -146,8 +146,8 @@ std::string* ServiceInterfaceBuffer::getPreamble(size_t * preambleSize) { #endif int32_t charCount = sprintf(parsePosition, - "%s: | %02" SCNu32 ":%02" SCNu32 ":%02" SCNu32 ".%03" SCNu32 " | ", - this->logMessage.c_str(), loggerTime.hour, + "%s%s | %02" SCNu32 ":%02" SCNu32 ":%02" SCNu32 ".%03" SCNu32 " | ", + this->logMessage.c_str(), sif::ANSI_COLOR_RESET, loggerTime.hour, loggerTime.minute, loggerTime.second, loggerTime.usecond /1000); @@ -171,9 +171,11 @@ bool ServiceInterfaceBuffer::crAdditionEnabled() const { return addCrToPreamble; } +#if FSFW_COLORED_OUTPUT == 1 void ServiceInterfaceBuffer::setAsciiColorPrefix(std::string colorPrefix) { - this->colorPrefix = colorPrefix; + this->colorPrefix = colorPrefix; } +#endif #ifdef UT699 #include "../osal/rtems/Interrupt.h" diff --git a/src/fsfw/serviceinterface/ServiceInterfacePrinter.cpp b/src/fsfw/serviceinterface/ServiceInterfacePrinter.cpp index 9b62e91da..422b47fcd 100644 --- a/src/fsfw/serviceinterface/ServiceInterfacePrinter.cpp +++ b/src/fsfw/serviceinterface/ServiceInterfacePrinter.cpp @@ -69,6 +69,10 @@ void fsfwPrint(sif::PrintLevel printType, const char* fmt, va_list arg) { len += sprintf(bufferPosition + len, "ERROR: "); } +#if FSFW_COLORED_OUTPUT == 1 + len += sprintf(bufferPosition, sif::ANSI_COLOR_RESET); +#endif + Clock::TimeOfDay_t now; Clock::getDateAndTime(&now); /* diff --git a/src/fsfw/serviceinterface/ServiceInterfaceStream.cpp b/src/fsfw/serviceinterface/ServiceInterfaceStream.cpp index fe45442df..6139299ba 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceStream.cpp +++ b/src/fsfw/serviceinterface/ServiceInterfaceStream.cpp @@ -19,9 +19,11 @@ bool ServiceInterfaceStream::crAdditionEnabled() const { return streambuf.crAdditionEnabled(); } +#if FSFW_COLORED_OUTPUT == 1 void ServiceInterfaceStream::setAsciiColorPrefix(std::string asciiColorCode) { streambuf.setAsciiColorPrefix(asciiColorCode); } +#endif #endif diff --git a/src/fsfw/serviceinterface/ServiceInterfaceStream.h b/src/fsfw/serviceinterface/ServiceInterfaceStream.h index aceddb22c..545ab2415 100644 --- a/src/fsfw/serviceinterface/ServiceInterfaceStream.h +++ b/src/fsfw/serviceinterface/ServiceInterfaceStream.h @@ -46,7 +46,9 @@ public: */ bool crAdditionEnabled() const; +#if FSFW_COLORED_OUTPUT == 1 void setAsciiColorPrefix(std::string asciiColorCode); +#endif protected: ServiceInterfaceBuffer streambuf; diff --git a/tests/src/CMakeLists.txt b/tests/src/CMakeLists.txt index ed2f2522e..6673f1e41 100644 --- a/tests/src/CMakeLists.txt +++ b/tests/src/CMakeLists.txt @@ -6,4 +6,4 @@ target_include_directories(${LIB_FSFW_NAME} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR} ) -add_subdirectory(fsfw) +add_subdirectory(fsfw_tests) diff --git a/tests/src/fsfw/CMakeLists.txt b/tests/src/fsfw/CMakeLists.txt deleted file mode 100644 index 571a126ee..000000000 --- a/tests/src/fsfw/CMakeLists.txt +++ /dev/null @@ -1 +0,0 @@ -add_subdirectory(tests) \ No newline at end of file diff --git a/tests/src/fsfw/tests/CMakeLists.txt b/tests/src/fsfw_tests/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/CMakeLists.txt rename to tests/src/fsfw_tests/CMakeLists.txt diff --git a/tests/src/fsfw/tests/internal/CMakeLists.txt b/tests/src/fsfw_tests/internal/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/internal/CMakeLists.txt rename to tests/src/fsfw_tests/internal/CMakeLists.txt diff --git a/tests/src/fsfw/tests/internal/InternalUnitTester.cpp b/tests/src/fsfw_tests/internal/InternalUnitTester.cpp similarity index 67% rename from tests/src/fsfw/tests/internal/InternalUnitTester.cpp rename to tests/src/fsfw_tests/internal/InternalUnitTester.cpp index 8631ce0d4..f9fc19327 100644 --- a/tests/src/fsfw/tests/internal/InternalUnitTester.cpp +++ b/tests/src/fsfw_tests/internal/InternalUnitTester.cpp @@ -1,11 +1,11 @@ -#include "fsfw/tests/internal/InternalUnitTester.h" -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/InternalUnitTester.h" +#include "fsfw_tests/internal/UnittDefinitions.h" -#include "fsfw/tests/internal/osal/IntTestMq.h" -#include "fsfw/tests/internal/osal/IntTestSemaphore.h" -#include "fsfw/tests/internal/osal/IntTestMutex.h" -#include "fsfw/tests/internal/serialize/IntTestSerialization.h" -#include "fsfw/tests/internal/globalfunctions/TestArrayPrinter.h" +#include "fsfw_tests/internal/osal/IntTestMq.h" +#include "fsfw_tests/internal/osal/IntTestSemaphore.h" +#include "fsfw_tests/internal/osal/IntTestMutex.h" +#include "fsfw_tests/internal/serialize/IntTestSerialization.h" +#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h" #include diff --git a/tests/src/fsfw/tests/internal/InternalUnitTester.h b/tests/src/fsfw_tests/internal/InternalUnitTester.h similarity index 100% rename from tests/src/fsfw/tests/internal/InternalUnitTester.h rename to tests/src/fsfw_tests/internal/InternalUnitTester.h diff --git a/tests/src/fsfw/tests/internal/UnittDefinitions.cpp b/tests/src/fsfw_tests/internal/UnittDefinitions.cpp similarity index 87% rename from tests/src/fsfw/tests/internal/UnittDefinitions.cpp rename to tests/src/fsfw_tests/internal/UnittDefinitions.cpp index 74fd53be8..7f754a0a4 100644 --- a/tests/src/fsfw/tests/internal/UnittDefinitions.cpp +++ b/tests/src/fsfw_tests/internal/UnittDefinitions.cpp @@ -1,4 +1,4 @@ -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/UnittDefinitions.h" ReturnValue_t unitt::put_error(std::string errorId) { #if FSFW_CPP_OSTREAM_ENABLED == 1 diff --git a/tests/src/fsfw/tests/internal/UnittDefinitions.h b/tests/src/fsfw_tests/internal/UnittDefinitions.h similarity index 100% rename from tests/src/fsfw/tests/internal/UnittDefinitions.h rename to tests/src/fsfw_tests/internal/UnittDefinitions.h diff --git a/tests/src/fsfw/tests/internal/globalfunctions/CMakeLists.txt b/tests/src/fsfw_tests/internal/globalfunctions/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/internal/globalfunctions/CMakeLists.txt rename to tests/src/fsfw_tests/internal/globalfunctions/CMakeLists.txt diff --git a/tests/src/fsfw/tests/internal/globalfunctions/TestArrayPrinter.cpp b/tests/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.cpp similarity index 94% rename from tests/src/fsfw/tests/internal/globalfunctions/TestArrayPrinter.cpp rename to tests/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.cpp index 905780955..b43113433 100644 --- a/tests/src/fsfw/tests/internal/globalfunctions/TestArrayPrinter.cpp +++ b/tests/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.cpp @@ -1,4 +1,4 @@ -#include "fsfw/tests/internal/globalfunctions/TestArrayPrinter.h" +#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h" void arrayprinter::testArrayPrinter() { { diff --git a/tests/src/fsfw/tests/internal/globalfunctions/TestArrayPrinter.h b/tests/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.h similarity index 100% rename from tests/src/fsfw/tests/internal/globalfunctions/TestArrayPrinter.h rename to tests/src/fsfw_tests/internal/globalfunctions/TestArrayPrinter.h diff --git a/tests/src/fsfw/tests/internal/osal/CMakeLists.txt b/tests/src/fsfw_tests/internal/osal/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/internal/osal/CMakeLists.txt rename to tests/src/fsfw_tests/internal/osal/CMakeLists.txt diff --git a/tests/src/fsfw/tests/internal/osal/IntTestMq.cpp b/tests/src/fsfw_tests/internal/osal/IntTestMq.cpp similarity index 93% rename from tests/src/fsfw/tests/internal/osal/IntTestMq.cpp rename to tests/src/fsfw_tests/internal/osal/IntTestMq.cpp index 91bc2c6d6..6c31b3541 100644 --- a/tests/src/fsfw/tests/internal/osal/IntTestMq.cpp +++ b/tests/src/fsfw_tests/internal/osal/IntTestMq.cpp @@ -1,5 +1,5 @@ -#include "fsfw/tests/internal/osal/IntTestMq.h" -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/osal/IntTestMq.h" +#include "fsfw_tests/internal/UnittDefinitions.h" #include #include diff --git a/tests/src/fsfw/tests/internal/osal/IntTestMq.h b/tests/src/fsfw_tests/internal/osal/IntTestMq.h similarity index 100% rename from tests/src/fsfw/tests/internal/osal/IntTestMq.h rename to tests/src/fsfw_tests/internal/osal/IntTestMq.h diff --git a/tests/src/fsfw/tests/internal/osal/IntTestMutex.cpp b/tests/src/fsfw_tests/internal/osal/IntTestMutex.cpp similarity index 92% rename from tests/src/fsfw/tests/internal/osal/IntTestMutex.cpp rename to tests/src/fsfw_tests/internal/osal/IntTestMutex.cpp index 9e7c1481f..b1699a46e 100644 --- a/tests/src/fsfw/tests/internal/osal/IntTestMutex.cpp +++ b/tests/src/fsfw_tests/internal/osal/IntTestMutex.cpp @@ -1,5 +1,5 @@ -#include "fsfw/tests/internal/osal/IntTestMutex.h" -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/osal/IntTestMutex.h" +#include "fsfw_tests/internal/UnittDefinitions.h" #include diff --git a/tests/src/fsfw/tests/internal/osal/IntTestMutex.h b/tests/src/fsfw_tests/internal/osal/IntTestMutex.h similarity index 100% rename from tests/src/fsfw/tests/internal/osal/IntTestMutex.h rename to tests/src/fsfw_tests/internal/osal/IntTestMutex.h diff --git a/tests/src/fsfw/tests/internal/osal/IntTestSemaphore.cpp b/tests/src/fsfw_tests/internal/osal/IntTestSemaphore.cpp similarity index 97% rename from tests/src/fsfw/tests/internal/osal/IntTestSemaphore.cpp rename to tests/src/fsfw_tests/internal/osal/IntTestSemaphore.cpp index e278e3c1c..8b79f33ba 100644 --- a/tests/src/fsfw/tests/internal/osal/IntTestSemaphore.cpp +++ b/tests/src/fsfw_tests/internal/osal/IntTestSemaphore.cpp @@ -1,5 +1,5 @@ -#include "fsfw/tests/internal/osal/IntTestSemaphore.h" -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/osal/IntTestSemaphore.h" +#include "fsfw_tests/internal/UnittDefinitions.h" #include #include diff --git a/tests/src/fsfw/tests/internal/osal/IntTestSemaphore.h b/tests/src/fsfw_tests/internal/osal/IntTestSemaphore.h similarity index 100% rename from tests/src/fsfw/tests/internal/osal/IntTestSemaphore.h rename to tests/src/fsfw_tests/internal/osal/IntTestSemaphore.h diff --git a/tests/src/fsfw/tests/internal/serialize/CMakeLists.txt b/tests/src/fsfw_tests/internal/serialize/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/internal/serialize/CMakeLists.txt rename to tests/src/fsfw_tests/internal/serialize/CMakeLists.txt diff --git a/tests/src/fsfw/tests/internal/serialize/IntTestSerialization.cpp b/tests/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp similarity index 98% rename from tests/src/fsfw/tests/internal/serialize/IntTestSerialization.cpp rename to tests/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp index 3489c759f..4720f706c 100644 --- a/tests/src/fsfw/tests/internal/serialize/IntTestSerialization.cpp +++ b/tests/src/fsfw_tests/internal/serialize/IntTestSerialization.cpp @@ -1,5 +1,5 @@ -#include "fsfw/tests/internal/serialize/IntTestSerialization.h" -#include "fsfw/tests/internal/UnittDefinitions.h" +#include "fsfw_tests/internal/serialize/IntTestSerialization.h" +#include "fsfw_tests/internal/UnittDefinitions.h" #include #include diff --git a/tests/src/fsfw/tests/internal/serialize/IntTestSerialization.h b/tests/src/fsfw_tests/internal/serialize/IntTestSerialization.h similarity index 100% rename from tests/src/fsfw/tests/internal/serialize/IntTestSerialization.h rename to tests/src/fsfw_tests/internal/serialize/IntTestSerialization.h diff --git a/tests/src/fsfw/tests/unit/CMakeLists.txt b/tests/src/fsfw_tests/unit/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/CMakeLists.txt rename to tests/src/fsfw_tests/unit/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/action/CMakeLists.txt b/tests/src/fsfw_tests/unit/action/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/action/CMakeLists.txt rename to tests/src/fsfw_tests/unit/action/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/action/TestActionHelper.cpp b/tests/src/fsfw_tests/unit/action/TestActionHelper.cpp similarity index 98% rename from tests/src/fsfw/tests/unit/action/TestActionHelper.cpp rename to tests/src/fsfw_tests/unit/action/TestActionHelper.cpp index d8bd58c99..126979f64 100644 --- a/tests/src/fsfw/tests/unit/action/TestActionHelper.cpp +++ b/tests/src/fsfw_tests/unit/action/TestActionHelper.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include diff --git a/tests/src/fsfw/tests/unit/action/TestActionHelper.h b/tests/src/fsfw_tests/unit/action/TestActionHelper.h similarity index 100% rename from tests/src/fsfw/tests/unit/action/TestActionHelper.h rename to tests/src/fsfw_tests/unit/action/TestActionHelper.h diff --git a/tests/src/fsfw/tests/unit/container/CMakeLists.txt b/tests/src/fsfw_tests/unit/container/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/container/CMakeLists.txt rename to tests/src/fsfw_tests/unit/container/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/container/RingBufferTest.cpp b/tests/src/fsfw_tests/unit/container/RingBufferTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/RingBufferTest.cpp rename to tests/src/fsfw_tests/unit/container/RingBufferTest.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestArrayList.cpp b/tests/src/fsfw_tests/unit/container/TestArrayList.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestArrayList.cpp rename to tests/src/fsfw_tests/unit/container/TestArrayList.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestDynamicFifo.cpp b/tests/src/fsfw_tests/unit/container/TestDynamicFifo.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestDynamicFifo.cpp rename to tests/src/fsfw_tests/unit/container/TestDynamicFifo.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestFifo.cpp b/tests/src/fsfw_tests/unit/container/TestFifo.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestFifo.cpp rename to tests/src/fsfw_tests/unit/container/TestFifo.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestFixedArrayList.cpp b/tests/src/fsfw_tests/unit/container/TestFixedArrayList.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestFixedArrayList.cpp rename to tests/src/fsfw_tests/unit/container/TestFixedArrayList.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestFixedMap.cpp b/tests/src/fsfw_tests/unit/container/TestFixedMap.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestFixedMap.cpp rename to tests/src/fsfw_tests/unit/container/TestFixedMap.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestFixedOrderedMultimap.cpp b/tests/src/fsfw_tests/unit/container/TestFixedOrderedMultimap.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestFixedOrderedMultimap.cpp rename to tests/src/fsfw_tests/unit/container/TestFixedOrderedMultimap.cpp diff --git a/tests/src/fsfw/tests/unit/container/TestPlacementFactory.cpp b/tests/src/fsfw_tests/unit/container/TestPlacementFactory.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/container/TestPlacementFactory.cpp rename to tests/src/fsfw_tests/unit/container/TestPlacementFactory.cpp diff --git a/tests/src/fsfw/tests/unit/datapoollocal/CMakeLists.txt b/tests/src/fsfw_tests/unit/datapoollocal/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/CMakeLists.txt rename to tests/src/fsfw_tests/unit/datapoollocal/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/datapoollocal/DataSetTest.cpp b/tests/src/fsfw_tests/unit/datapoollocal/DataSetTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/DataSetTest.cpp rename to tests/src/fsfw_tests/unit/datapoollocal/DataSetTest.cpp diff --git a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolManagerTest.cpp b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolManagerTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/LocalPoolManagerTest.cpp rename to tests/src/fsfw_tests/unit/datapoollocal/LocalPoolManagerTest.cpp diff --git a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolOwnerBase.cpp b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolOwnerBase.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/LocalPoolOwnerBase.cpp rename to tests/src/fsfw_tests/unit/datapoollocal/LocalPoolOwnerBase.cpp diff --git a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolOwnerBase.h b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolOwnerBase.h similarity index 99% rename from tests/src/fsfw/tests/unit/datapoollocal/LocalPoolOwnerBase.h rename to tests/src/fsfw_tests/unit/datapoollocal/LocalPoolOwnerBase.h index 4c244b169..c0e41ddf6 100644 --- a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolOwnerBase.h +++ b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolOwnerBase.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include namespace lpool { diff --git a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolVariableTest.cpp b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolVariableTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/LocalPoolVariableTest.cpp rename to tests/src/fsfw_tests/unit/datapoollocal/LocalPoolVariableTest.cpp diff --git a/tests/src/fsfw/tests/unit/datapoollocal/LocalPoolVectorTest.cpp b/tests/src/fsfw_tests/unit/datapoollocal/LocalPoolVectorTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/datapoollocal/LocalPoolVectorTest.cpp rename to tests/src/fsfw_tests/unit/datapoollocal/LocalPoolVectorTest.cpp diff --git a/tests/src/fsfw/tests/unit/globalfunctions/CMakeLists.txt b/tests/src/fsfw_tests/unit/globalfunctions/CMakeLists.txt similarity index 64% rename from tests/src/fsfw/tests/unit/globalfunctions/CMakeLists.txt rename to tests/src/fsfw_tests/unit/globalfunctions/CMakeLists.txt index 4ea49bf74..8e57e01be 100644 --- a/tests/src/fsfw/tests/unit/globalfunctions/CMakeLists.txt +++ b/tests/src/fsfw_tests/unit/globalfunctions/CMakeLists.txt @@ -1,3 +1,2 @@ target_sources(${TARGET_NAME} PRIVATE - TestArrayPrinter.cpp ) diff --git a/tests/src/fsfw/tests/unit/mocks/HkReceiverMock.h b/tests/src/fsfw_tests/unit/mocks/HkReceiverMock.h similarity index 100% rename from tests/src/fsfw/tests/unit/mocks/HkReceiverMock.h rename to tests/src/fsfw_tests/unit/mocks/HkReceiverMock.h diff --git a/tests/src/fsfw/tests/unit/mocks/MessageQueueMockBase.h b/tests/src/fsfw_tests/unit/mocks/MessageQueueMockBase.h similarity index 100% rename from tests/src/fsfw/tests/unit/mocks/MessageQueueMockBase.h rename to tests/src/fsfw_tests/unit/mocks/MessageQueueMockBase.h diff --git a/tests/src/fsfw/tests/unit/osal/CMakeLists.txt b/tests/src/fsfw_tests/unit/osal/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/osal/CMakeLists.txt rename to tests/src/fsfw_tests/unit/osal/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/osal/TestMessageQueue.cpp b/tests/src/fsfw_tests/unit/osal/TestMessageQueue.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/osal/TestMessageQueue.cpp rename to tests/src/fsfw_tests/unit/osal/TestMessageQueue.cpp diff --git a/tests/src/fsfw/tests/unit/osal/TestSemaphore.cpp b/tests/src/fsfw_tests/unit/osal/TestSemaphore.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/osal/TestSemaphore.cpp rename to tests/src/fsfw_tests/unit/osal/TestSemaphore.cpp diff --git a/tests/src/fsfw/tests/unit/serialize/CMakeLists.txt b/tests/src/fsfw_tests/unit/serialize/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/serialize/CMakeLists.txt rename to tests/src/fsfw_tests/unit/serialize/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/serialize/TestSerialBufferAdapter.cpp b/tests/src/fsfw_tests/unit/serialize/TestSerialBufferAdapter.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/serialize/TestSerialBufferAdapter.cpp rename to tests/src/fsfw_tests/unit/serialize/TestSerialBufferAdapter.cpp diff --git a/tests/src/fsfw/tests/unit/serialize/TestSerialLinkedPacket.cpp b/tests/src/fsfw_tests/unit/serialize/TestSerialLinkedPacket.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/serialize/TestSerialLinkedPacket.cpp rename to tests/src/fsfw_tests/unit/serialize/TestSerialLinkedPacket.cpp diff --git a/tests/src/fsfw/tests/unit/serialize/TestSerialLinkedPacket.h b/tests/src/fsfw_tests/unit/serialize/TestSerialLinkedPacket.h similarity index 100% rename from tests/src/fsfw/tests/unit/serialize/TestSerialLinkedPacket.h rename to tests/src/fsfw_tests/unit/serialize/TestSerialLinkedPacket.h diff --git a/tests/src/fsfw/tests/unit/serialize/TestSerialization.cpp b/tests/src/fsfw_tests/unit/serialize/TestSerialization.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/serialize/TestSerialization.cpp rename to tests/src/fsfw_tests/unit/serialize/TestSerialization.cpp diff --git a/tests/src/fsfw/tests/unit/storagemanager/CMakeLists.txt b/tests/src/fsfw_tests/unit/storagemanager/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/storagemanager/CMakeLists.txt rename to tests/src/fsfw_tests/unit/storagemanager/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/storagemanager/TestNewAccessor.cpp b/tests/src/fsfw_tests/unit/storagemanager/TestNewAccessor.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/storagemanager/TestNewAccessor.cpp rename to tests/src/fsfw_tests/unit/storagemanager/TestNewAccessor.cpp diff --git a/tests/src/fsfw/tests/unit/storagemanager/TestPool.cpp b/tests/src/fsfw_tests/unit/storagemanager/TestPool.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/storagemanager/TestPool.cpp rename to tests/src/fsfw_tests/unit/storagemanager/TestPool.cpp diff --git a/tests/src/fsfw/tests/unit/tmtcpacket/CMakeLists.txt b/tests/src/fsfw_tests/unit/tmtcpacket/CMakeLists.txt similarity index 100% rename from tests/src/fsfw/tests/unit/tmtcpacket/CMakeLists.txt rename to tests/src/fsfw_tests/unit/tmtcpacket/CMakeLists.txt diff --git a/tests/src/fsfw/tests/unit/tmtcpacket/PusTmTest.cpp b/tests/src/fsfw_tests/unit/tmtcpacket/PusTmTest.cpp similarity index 100% rename from tests/src/fsfw/tests/unit/tmtcpacket/PusTmTest.cpp rename to tests/src/fsfw_tests/unit/tmtcpacket/PusTmTest.cpp diff --git a/tests/user/CMakeLists.txt b/tests/user/CMakeLists.txt index 722cc424c..df16c7567 100644 --- a/tests/user/CMakeLists.txt +++ b/tests/user/CMakeLists.txt @@ -1,8 +1,5 @@ ################################################################################ # CMake support for the Flight Software Framework Tests -# -# Developed in an effort to replace Make with a modern build system. -# # Author: R. Mueller ################################################################################ @@ -12,6 +9,7 @@ cmake_minimum_required(VERSION 3.13) # set(CMAKE_VERBOSE TRUE) +# set(CODE_COVERAGE_VERBOSE TRUE) set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") @@ -21,6 +19,8 @@ option(GENERATE_COVERAGE TRUE ) +set(FSFW_ADD_UNITTESTS ON) + if(TMTC_TEST) set(LINK_CATCH2 FALSE) else() @@ -28,20 +28,16 @@ else() endif() # Tests can be built with the Host OSAL or with the Linux OSAL. -if(NOT OS_FSFW) - set(OS_FSFW host CACHE STRING "OS for the FSFW.") +if(NOT FSFW_OSAL) + set(FSFW_OSAL host CACHE STRING "OS for the FSFW.") endif() option(CUSTOM_UNITTEST_RUNNER "Specify whether custom main or Catch2 main is used" TRUE ) -# Perform steps like loading toolchain files where applicable. -#include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) -#pre_project_config() - # Project Name -project(fsfw_tests C CXX) +project(fsfw-tests C CXX) ################################################################################ # Pre-Sources preparation @@ -71,7 +67,7 @@ set(TMTC_TEST_PATH tests) # determine BSP_PATH # FreeRTOS -if(${OS_FSFW} STREQUAL linux) +if(FSFW_OSAL STREQUAL linux) add_definitions(-DUNIX -DLINUX) find_package(Threads REQUIRED) # Hosted @@ -94,6 +90,11 @@ if(GENERATE_COVERAGE) endif() set(FSFW_CONFIG_PATH testcfg) +set(FSFW_ADDITIONAL_INC_PATHS ${CMAKE_CURRENT_BINARY_DIR}) + +configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) +configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) +configure_file(${FSFW_CONFIG_PATH}/TestsConfig.h.in TestsConfig.h) ################################################################################ # Executable and Sources @@ -108,10 +109,16 @@ add_subdirectory(${FSFW_CONFIG_PATH}) if(LINK_CATCH2) add_subdirectory(${CATCH2_PATH}) - add_subdirectory(${FSFW_TESTS_PATH}) add_subdirectory(${TEST_SETUP_PATH}) else() + target_compile_definitions(${TARGET_NAME} PRIVATE + FSFW_DISABLE_PRINTOUT=0 + ) + target_compile_definitions(${LIB_FSFW_NAME} PRIVATE + FSFW_DISABLE_PRINTOUT=0 + ) add_subdirectory(${TMTC_TEST_PATH}) + add_subdirectory(${FSFW_TESTS_PATH}) endif() @@ -132,7 +139,7 @@ endif() if(GENERATE_COVERAGE) if(CMAKE_COMPILER_IS_GNUCXX) - set(CODE_COVERAGE_VERBOSE TRUE) + # set(CODE_COVERAGE_VERBOSE TRUE) include(CodeCoverage) # Remove quotes. @@ -194,6 +201,7 @@ endif() target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH} + ${CMAKE_CURRENT_BINARY_DIR} ) if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") @@ -225,12 +233,9 @@ if(CMAKE_VERBOSE) message(STATUS "Warning flags: ${WARNING_FLAGS}") endif() - # Compile options for all sources. target_compile_options(${TARGET_NAME} PRIVATE - $<$:${WARNING_FLAGS} ${COMPILER_FLAGS}> - $<$:${WARNING_FLAGS} ${COMPILER_FLAGS}> - ${ABI_FLAGS} + ${WARNING_FLAGS} ) if(NOT CMAKE_SIZE) @@ -240,18 +245,17 @@ if(NOT CMAKE_SIZE) endif() endif() +string(CONCAT POST_BUILD_COMMENT + "Build directory: ${CMAKE_BINARY_DIR}\n" + "Target OSAL: ${FSFW_OSAL}\n" + "Target Build Type: ${CMAKE_BUILD_TYPE}" +) + add_custom_command(TARGET ${TARGET_NAME} - POST_BUILD - COMMAND echo "Build directory: ${CMAKE_BINARY_DIR}" - COMMAND echo "Target OSAL: ${OS_FSFW}" - COMMAND echo "Target Build Type: ${CMAKE_BUILD_TYPE}" - COMMAND ${CMAKE_SIZE} ${TARGET_NAME}${FILE_SUFFIX} + POST_BUILD + COMMAND ${CMAKE_SIZE} ${TARGET_NAME}${FILE_SUFFIX} + COMMENT ${POST_BUILD_COMMENT} ) include (${CMAKE_SCRIPT_PATH}/BuildType.cmake) set_build_type() - - - - - diff --git a/tests/user/testcfg/FSFWConfig.h b/tests/user/testcfg/FSFWConfig.h.in similarity index 68% rename from tests/user/testcfg/FSFWConfig.h rename to tests/user/testcfg/FSFWConfig.h.in index ed86e6e1f..d38f0648f 100644 --- a/tests/user/testcfg/FSFWConfig.h +++ b/tests/user/testcfg/FSFWConfig.h.in @@ -7,18 +7,24 @@ //! Used to determine whether C++ ostreams are used which can increase //! the binary size significantly. If this is disabled, //! the C stdio functions can be used alternatively -#define FSFW_CPP_OSTREAM_ENABLED 1 +#define FSFW_CPP_OSTREAM_ENABLED 0 -//! More FSFW related printouts depending on level. Useful for development. -#define FSFW_VERBOSE_LEVEL 1 +//! More FSFW related printouts. Useful for development. +#define FSFW_ENHANCED_PRINTOUT 0 //! Can be used to completely disable printouts, even the C stdio ones. -#if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_VERBOSE_LEVEL == 0 - #define FSFW_DISABLE_PRINTOUT 0 +//! By default, printouts will be disabled for the unit tests. +#if FSFW_CPP_OSTREAM_ENABLED == 0 && FSFW_ENHANCED_PRINTOUT == 0 + #ifndef FSFW_DISABLE_PRINTOUT + #define FSFW_DISABLE_PRINTOUT 1 + #endif #endif +//! Can be used to enable additional debugging printouts for developing the FSFW +#define FSFW_PRINT_VERBOSITY_LEVEL 0 + //! Can be used to disable the ANSI color sequences for C stdio. -#define FSFW_COLORED_OUTPUT 1 +#define FSFW_COLORED_OUTPUT 0 //! If FSFW_OBJ_EVENT_TRANSLATION is set to one, //! additional output which requires the translation files translateObjects @@ -40,6 +46,13 @@ //! Specify whether a special mode store is used for Subsystem components. #define FSFW_USE_MODESTORE 0 +//! Defines if the real time scheduler for linux should be used. +//! If set to 0, this will also disable priority settings for linux +//! as most systems will not allow to set nice values without privileges +//! For embedded linux system set this to 1. +//! If set to 1 the binary needs "cap_sys_nice=eip" privileges to run +#define FSFW_USE_REALTIME_FOR_LINUX 1 + namespace fsfwconfig { //! Default timestamp size. The default timestamp will be an eight byte CDC //! short timestamp. @@ -57,6 +70,9 @@ static constexpr size_t FSFW_EVENTMGMR_RANGEMATCHERS = 120; static constexpr uint8_t FSFW_CSB_FIFO_DEPTH = 6; static constexpr size_t FSFW_PRINT_BUFFER_SIZE = 124; + +static constexpr size_t FSFW_MAX_TM_PACKET_SIZE = 1500; + } #endif /* CONFIG_FSFWCONFIG_H_ */ diff --git a/tests/user/testcfg/Makefile-FSFW-Tests b/tests/user/testcfg/Makefile-FSFW-Tests deleted file mode 100644 index 550fd1dee..000000000 --- a/tests/user/testcfg/Makefile-FSFW-Tests +++ /dev/null @@ -1,416 +0,0 @@ -#------------------------------------------------------------------------------- -# Makefile for FSFW Test -#------------------------------------------------------------------------------- -# User-modifiable options -#------------------------------------------------------------------------------- -# Fundamentals on the build process of C/C++ Software: -# https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html - -# Make documentation: https://www.gnu.org/software/make/manual/make.pdf -# Online: https://www.gnu.org/software/make/manual/make.html -# General rules: http://make.mad-scientist.net/papers/rules-of-makefiles/#rule3 -SHELL = /bin/sh - -# Chip & board used for compilation -# (can be overriden by adding CHIP=chip and BOARD=board to the command-line) -# Unit Test can only be run on host machine for now (Linux) -FRAMEWORK_PATH = fsfw -TEST_FILE_ROOT = $(FRAMEWORK_PATH)/unittest -BOARD = unittest -LINUX = 1 -OS_FSFW = linux -CUSTOM_DEFINES += -D$(OS_FSFW) - -# Copied from stackoverflow, can be used to differentiate between Windows -# and Linux -ifeq ($(OS),Windows_NT) - CUSTOM_DEFINES += -DWIN32 - ifeq ($(PROCESSOR_ARCHITEW6432),AMD64) - CUSTOM_DEFINES += -DAMD64 - else - ifeq ($(PROCESSOR_ARCHITECTURE),AMD64) - CUSTOM_DEFINES += -DAMD64 - endif - ifeq ($(PROCESSOR_ARCHITECTURE),x86) - CUSTOM_DEFINES += -DIA32 - endif - endif -else - UNAME_S := $(shell uname -s) - ifeq ($(UNAME_S),Linux) - DETECTED_OS = LINUX - CUSTOM_DEFINES += -DLINUX - endif - ifeq ($(UNAME_S),Darwin) - CUSTOM_DEFINES += -DOSX - endif - UNAME_P := $(shell uname -p) - ifeq ($(UNAME_P),x86_64) - CUSTOM_DEFINES += -DAMD64 - endif - ifneq ($(filter %86,$(UNAME_P)),) - CUSTOM_DEFINES += -DIA32 - endif - ifneq ($(filter arm%,$(UNAME_P)),) - CUSTOM_DEFINES += -DARM - endif -endif - -UNIT_TEST = 1 -# General folder paths -CONFIG_PATH = testcfg -# Core copy has to be copied as well. -CORE_PATH = core -UNIT_TEST_PATH = $(TEST_FILE_ROOT)/tests - -# Output file basename -BASENAME = fsfw -BINARY_NAME := $(BASENAME)-$(BOARD) -# Output files will be put in this directory inside -OUTPUT_FOLDER = $(OS) - -# Optimization level. Optimized for debugging. -OPTIMIZATION = -O0 - -# Default debug output. Optimized for debugging. -DEBUG_LEVEL = -g3 - -ifdef GCOV -CUSTOM_DEFINES += -DGCOV -endif - - -# Output directories -BUILDPATH = _bin -DEPENDPATH = _dep -OBJECTPATH = _obj - -ifeq ($(MAKECMDGOALS),mission) -BUILD_FOLDER = mission -else -BUILD_FOLDER = devel -endif - -DEPENDDIR = $(DEPENDPATH)/$(OUTPUT_FOLDER)/$(BUILD_FOLDER) -OBJDIR = $(OBJECTPATH)/$(OUTPUT_FOLDER)/$(BUILD_FOLDER) -BINDIR = $(BUILDPATH) - -CLEANDEP = $(DEPENDPATH)/$(OUTPUT_FOLDER) -CLEANOBJ = $(OBJECTPATH)/$(OUTPUT_FOLDER) -CLEANBIN = $(BUILDPATH) -#------------------------------------------------------------------------------- -# Tools and Includes -#------------------------------------------------------------------------------- - -# Tool suffix when cross-compiling -CROSS_COMPILE = - -# C Compiler -CC = $(CROSS_COMPILE)gcc - -# C++ compiler -CXX = $(CROSS_COMPILE)g++ - -# Additional Tools -SIZE = $(CROSS_COMPILE)size -STRIP = $(CROSS_COMPILE)strip -CP = $(CROSS_COMPILE)objcopy - -HEXCOPY = $(CP) -O ihex -BINCOPY = $(CP) -O binary -# files to be compiled, will be filled in by include makefiles -# := assignment is neccessary so we get all paths right -# https://www.gnu.org/software/make/manual/html_node/Flavors.html -CSRC := -CXXSRC := -ASRC := -INCLUDES := - -# Directories where $(directoryname).mk files should be included from -SUBDIRS := $(FRAMEWORK_PATH) $(TEST_PATH) $(UNIT_TEST_PATH) $(CONFIG_PATH) \ - $(CORE_PATH) - - -I_INCLUDES += $(addprefix -I, $(INCLUDES)) - -# This is a hack from http://make.mad-scientist.net/the-eval-function/ -# -# The problem is, that included makefiles should be aware of their relative path -# but not need to guess or hardcode it. So we set $(CURRENTPATH) for them. If -# we do this globally and the included makefiles want to include other makefiles as -# well, they would overwrite $(CURRENTPATH), screwing the include after them. -# -# By using a for-loop with an eval'd macro, we can generate the code to include all -# sub-makefiles (with the correct $(CURRENTPATH) set) before actually evaluating -# (and by this possibly changing $(CURRENTPATH)) them. -# -# This works recursively, if an included makefile wants to include, it can safely set -# $(SUBDIRS) (which has already been evaluated here) and do -# "$(foreach S,$(SUBDIRS),$(eval $(INCLUDE_FILE)))" -# $(SUBDIRS) must be relative to the project root, so to include subdir foo, set -# $(SUBDIRS) = $(CURRENTPATH)/foo. -define INCLUDE_FILE -CURRENTPATH := $S -include $(S)/$(notdir $S).mk -endef -$(foreach S,$(SUBDIRS),$(eval $(INCLUDE_FILE))) - -INCLUDES += $(TEST_FILE_ROOT) -INCLUDES += $(TEST_FILE_ROOT)/catch2/ - -#------------------------------------------------------------------------------- -# Source Files -#------------------------------------------------------------------------------- - -# All source files which are not includes by the .mk files are added here -# Please ensure that no files are included by both .mk file and here ! - -# if a target is not listed in the current directory, -# make searches in the directories specified with VPATH - -# All C Sources included by .mk files are assigned here -# Add the objects to sources so dependency handling works -C_OBJECTS += $(CSRC:.c=.o) - -# Objects built from Assembly source files -ASM_OBJECTS = $(ASRC:.S=.o) - -# Objects built from C++ source files -CXX_OBJECTS += $(CXXSRC:.cpp=.o) - -#------------------------------------------------------------------------------- -# Build Configuration + Output -#------------------------------------------------------------------------------- - -TARGET = Debug build. -DEBUG_MESSAGE = Off -OPTIMIZATION_MESSAGE = Off - -# Define Messages -MSG_INFO = Software: Hosted unittest \(Catch2\) for the FSFW. -MSG_OPTIMIZATION = Optimization: $(OPTIMIZATION), $(OPTIMIZATION_MESSAGE) -MSG_TARGET = Target Build: $(TARGET) -MSG_DEBUG = Debug level: $(DEBUG_LEVEL), FSFW Debugging: $(DEBUG_MESSAGE) - -MSG_LINKING = Linking: -MSG_COMPILING = Compiling: -MSG_ASSEMBLING = Assembling: -MSG_DEPENDENCY = Collecting dependencies for: -MSG_BINARY = Generate binary: - -# See https://stackoverflow.com/questions/6687630/how-to-remove-unused-c-c-symbols-with-gcc-and-ld -# Used to throw away unused code. Reduces code size significantly ! -# -Wl,--gc-sections: needs to be passed to the linker to throw aways unused code -ifdef KEEP_UNUSED_CODE -PROTOTYPE_OPTIMIZATION = -UNUSED_CODE_REMOVAL = -else -PROTOTYPE_OPTIMIZATION = -ffunction-sections -fdata-sections -UNUSED_CODE_REMOVAL = -Wl,--gc-sections -# Link time optimization -# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html for reference -# Link time is larger and size of object files can not be retrieved -# but resulting binary is smaller. Could be used in mission/deployment build -# Requires -ffunction-section in linker call -LINK_TIME_OPTIMIZATION = -flto -OPTIMIZATION += $(PROTOTYPE_OPTIMIZATION) -endif - -# Dependency Flags -# These flags tell the compiler to build dependencies -# See: https://www.gnu.org/software/make/manual/html_node/Automatic-Prerequisites.html -# Using following guide: http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/#combine -DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPENDDIR)/$*.d - -# Flags for the compiler call -# - std: Which C++ version to use. Common versions: c++11, c++14 and c++17 -# - Wall: enable all warnings -# - Wextra: enable extra warnings -# - g: defines debug level -# - fmessage-length: to control the formatting algorithm for diagnostic messages; -# =0 means no line-wrapping is done; each error message appears on a single line -# - fno-exceptions: stops generating extra code needed to propagate exceptions, -# which can produce significant data size overhead -CUSTOM_DEFINES += -DUNIT_TEST -WARNING_FLAGS = -Wall -Wshadow=local -Wextra -Wimplicit-fallthrough=1 \ - -Wno-unused-parameter - -CXXDEFINES := $(CUSTOM_DEFINES) -CFLAGS += -CXXFLAGS += -I. $(DEBUG_LEVEL) $(WARNING_FLAGS) $(DEPFLAGS) -fmessage-length=0 $(OPTIMIZATION)\ - $(I_INCLUDES) $(CXXDEFINES) -CPPFLAGS += -std=c++11 - -# Flags for the linker call -# LINK_INCLUDES specify the path to used libraries and the linker script -# LINK_LIBRARIES: Link real time support -LDFLAGS := $(DEBUG_LEVEL) $(UNUSED_CODE_REMOVAL) $(OPTIMIZATION) -pthread -LINK_INCLUDES := -LINK_LIBRARIES := - -ifdef LINUX -LINK_LIBRARIES += -lrt -endif - -ifeq ($(OS),Windows_NT) -LINK_LIBRARIES += -lwsock32 -lws2_32 -LDFLASGS += -fuse-ld=lld -endif - -# Gnu Coverage Tools Flags -ifdef GCOV -GCOV_CXXFLAGS = -fprofile-arcs -ftest-coverage --coverage -fno-inline \ - -fno-inline-small-functions -fno-default-inline -CXXFLAGS += $(GCOV_CXXFLAGS) -GCOV_LINKER_LIBS = -lgcov -fprofile-arcs -ftest-coverage -LINK_LIBRARIES += $(GCOV_LINKER_LIBS) -endif - -# $(info $${CXXFLAGS} is [${CXXFLAGS}]) - -#------------------------------------------------------------------------------- -# Rules -#------------------------------------------------------------------------------- -# the call function assigns parameters to temporary variables -# https://www.gnu.org/software/make/manual/make.html#Call-Function -# $(1) = Memory names -# Rules are called for each memory type -# Two Expansion Symbols $$ are to escape the dollar sign for eval. -# See: http://make.mad-scientist.net/the-eval-function/ - -default: all - -# Cleans all files -hardclean: - -rm -rf $(BUILDPATH) - -rm -rf $(OBJECTPATH) - -rm -rf $(DEPENDPATH) - -# Only clean files for current build -clean: - -rm -rf $(CLEANOBJ) - -rm -rf $(CLEANBIN) - -rm -rf $(CLEANDEP) - -# Only clean binaries. Useful for changing the binary type when object files -# are already compiled so complete rebuild is not necessary -cleanbin: - -rm -rf $(CLEANBIN) - -# In this section, the binaries are built for all selected memories -# notestfw: all -all: executable - -# Build target configuration -release: OPTIMIZATION = -Os $(PROTOTYPE_OPTIMIZATION) $(LINK_TIME_OPTIMIZATION) -release: LINK_TIME_OPTIMIZATION = -flto -release: TARGET = Mission build. -release: OPTIMIZATION_MESSAGE = On with Link Time Optimization - -debug: CXXDEFINES += -DDEBUG -debug: TARGET = Debug -debug: DEBUG_MESSAGE = On - -ifndef KEEP_UNUSED_CODE -debug release: OPTIMIZATION_MESSAGE += , no unused code removal -endif - -debug release notestfw: executable - -executable: $(BINDIR)/$(BINARY_NAME).elf - @echo - @echo $(MSG_INFO) - @echo $(MSG_TARGET) - @echo $(MSG_OPTIMIZATION) - @echo $(MSG_DEBUG) - -C_OBJECTS_PREFIXED = $(addprefix $(OBJDIR)/, $(C_OBJECTS)) -CXX_OBJECTS_PREFIXED = $(addprefix $(OBJDIR)/, $(CXX_OBJECTS)) -ASM_OBJECTS_PREFIXED = $(addprefix $(OBJDIR)/, $(ASM_OBJECTS)) -ALL_OBJECTS = $(ASM_OBJECTS_PREFIXED) $(C_OBJECTS_PREFIXED) \ - $(CXX_OBJECTS_PREFIXED) - -# Useful for debugging the Makefile -# Also see: https://www.oreilly.com/openbook/make3/book/ch12.pdf -# $(info $${ALL_OBJECTS} is [${ALL_OBJECTS}]) -# $(info $${CXXSRC} is [${CXXSRC}]) - -# Automatic variables are used here extensively. Some of them -# are escaped($$) to suppress immediate evaluation. The most important ones are: -# $@: Name of Target (left side of rule) -# $<: Name of the first prerequisite (right side of rule) -# @^: List of all prerequisite, omitting duplicates -# @D: Directory and file-within-directory part of $@ - -# Generates binary and displays all build properties -# -p with mkdir ignores error and creates directory when needed. - -# SHOW_DETAILS = 1 - - -# Link with required libraries: HAL (Hardware Abstraction Layer) and -# HCC (File System Library) -$(BINDIR)/$(BINARY_NAME).elf: $(ALL_OBJECTS) - @echo - @echo $(MSG_LINKING) Target $@ - @mkdir -p $(@D) -ifdef SHOW_DETAILS - $(CXX) $(LDFLAGS) $(LINK_INCLUDES) -o $@ $^ $(LINK_LIBRARIES) -else - @$(CXX) $(LDFLAGS) $(LINK_INCLUDES) -o $@ $^ $(LINK_LIBRARIES) -endif -ifeq ($(BUILD_FOLDER), mission) -# With Link Time Optimization, section size is not available - $(SIZE) $@ -else - $(SIZE) $^ $@ -endif - -$(BINDIR)/$(BINARY_NAME).hex: $(BINDIR)/$(BINARY_NAME).elf - @echo - @echo $(MSG_BINARY) - @mkdir -p $(@D) - $(HEXCOPY) $< $@ - -# Build new objects for changed dependencies. -$(OBJDIR)/%.o: %.cpp -$(OBJDIR)/%.o: %.cpp $(DEPENDDIR)/%.d | $(DEPENDDIR) - @echo - @echo $(MSG_COMPILING) $< - @mkdir -p $(@D) -ifdef SHOW_DETAILS - $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< -else - @$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c -o $@ $< -endif - -$(OBJDIR)/%.o: %.c -$(OBJDIR)/%.o: %.c $(DEPENDDIR)/%.d | $(DEPENDDIR) - @echo - @echo $(MSG_COMPILING) $< - @mkdir -p $(@D) -ifdef SHOW_DETAILS - $(CC) $(CXXFLAGS) $(CFLAGS) -c -o $@ $< -else - @$(CC) $(CXXFLAGS) $(CFLAGS) -c -o $@ $< -endif - -#------------------------------------------------------------------------------- -# Dependency Handling -#------------------------------------------------------------------------------- - -# Dependency Handling according to following guide: -# http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ -$(DEPENDDIR): - @mkdir -p $(@D) -DEPENDENCY_RELATIVE = $(CSRC:.c=.d) $(CXXSRC:.cpp=.d) -# This is the list of all dependencies -DEPFILES = $(addprefix $(DEPENDDIR)/, $(DEPENDENCY_RELATIVE)) -# Create subdirectories for dependencies -$(DEPFILES): - @mkdir -p $(@D) -# Include all dependencies -include $(wildcard $(DEPFILES)) - -# .PHONY tells make that these targets aren't files -.PHONY: clean release debug all hardclean cleanbin diff --git a/tests/user/testcfg/OBSWConfig.h.in b/tests/user/testcfg/OBSWConfig.h.in new file mode 100644 index 000000000..34eda31f0 --- /dev/null +++ b/tests/user/testcfg/OBSWConfig.h.in @@ -0,0 +1,8 @@ +#ifndef TESTCFG_OBSWCONFIG_H_ +#define TESTCFG_OBSWCONFIG_H_ + + + + + +#endif /* TESTCFG_OBSWCONFIG_H_ */ diff --git a/tests/user/testcfg/TestsConfig.h b/tests/user/testcfg/TestsConfig.h deleted file mode 100644 index cd967fa73..000000000 --- a/tests/user/testcfg/TestsConfig.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ -#define FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ - - -#define CUSTOM_UNITTEST_RUNNER 0 - - -#endif /* FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ */ diff --git a/tests/user/testcfg/TestsConfig.h.in b/tests/user/testcfg/TestsConfig.h.in new file mode 100644 index 000000000..0341583de --- /dev/null +++ b/tests/user/testcfg/TestsConfig.h.in @@ -0,0 +1,19 @@ +#ifndef FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ +#define FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ + +#ifdef __cplusplus + +#include "objects/systemObjectList.h" +#include "events/subsystemIdRanges.h" +#include "returnvalues/classIds.h" + +namespace config { +#endif + +/* Add mission configuration flags here */ + +#ifdef __cplusplus +} +#endif + +#endif /* FSFW_UNITTEST_CONFIG_TESTSCONFIG_H_ */ diff --git a/tests/user/testcfg/cdatapool/dataPoolInit.cpp b/tests/user/testcfg/cdatapool/dataPoolInit.cpp deleted file mode 100644 index ad2dc4ef5..000000000 --- a/tests/user/testcfg/cdatapool/dataPoolInit.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "dataPoolInit.h" - -void datapool::dataPoolInit(std::map * poolMap) { - -} diff --git a/tests/user/testcfg/cdatapool/dataPoolInit.h b/tests/user/testcfg/cdatapool/dataPoolInit.h deleted file mode 100644 index 9425d7678..000000000 --- a/tests/user/testcfg/cdatapool/dataPoolInit.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ -#define HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ - -#include -#include -#include -#include - - -namespace datapool { - void dataPoolInit(std::map * poolMap); - - enum datapoolvariables { - NO_PARAMETER = 0, - }; -} -#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */ diff --git a/tests/user/testcfg/objects/systemObjectList.h b/tests/user/testcfg/objects/systemObjectList.h index 76f1ff90c..efd21e0de 100644 --- a/tests/user/testcfg/objects/systemObjectList.h +++ b/tests/user/testcfg/objects/systemObjectList.h @@ -15,14 +15,17 @@ namespace objects { PUS_DISTRIBUTOR = 11, TM_FUNNEL = 12, - TCPIP_BRIDGE = 15, - TCPIP_HELPER = 16, + UDP_BRIDGE = 15, + UDP_POLLING_TASK = 16, TEST_ECHO_COM_IF = 20, TEST_DEVICE = 21, HK_RECEIVER_MOCK = 22, - TEST_LOCAL_POOL_OWNER_BASE = 25 + TEST_LOCAL_POOL_OWNER_BASE = 25, + + SHARED_SET_ID = 26 + }; } diff --git a/tests/user/testcfg/pollingsequence/PollingSequenceFactory.cpp b/tests/user/testcfg/pollingsequence/PollingSequenceFactory.cpp index b7f1fb3e1..e3ee874a4 100644 --- a/tests/user/testcfg/pollingsequence/PollingSequenceFactory.cpp +++ b/tests/user/testcfg/pollingsequence/PollingSequenceFactory.cpp @@ -1,6 +1,8 @@ #include "PollingSequenceFactory.h" -#include +#include + +#include #include #include @@ -10,14 +12,26 @@ ReturnValue_t pst::pollingSequenceInitDefault( uint32_t length = thisSequence->getPeriodMs(); /* Add polling sequence table here */ + thisSequence->addSlot(objects::TEST_DEVICE, 0, + DeviceHandlerIF::PERFORM_OPERATION); + thisSequence->addSlot(objects::TEST_DEVICE, 0.3, + DeviceHandlerIF::SEND_WRITE); + thisSequence->addSlot(objects::TEST_DEVICE, 0.45 * length, + DeviceHandlerIF::GET_WRITE); + thisSequence->addSlot(objects::TEST_DEVICE, 0.6 * length, + DeviceHandlerIF::SEND_READ); + thisSequence->addSlot(objects::TEST_DEVICE, 0.8 * length, + DeviceHandlerIF::GET_READ); if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { return HasReturnvaluesIF::RETURN_OK; } else { -#if FSFW_CPP_OSTREAM_ENABLED == 1 +#if FSFW_CPP_OSTREAM_ENABLED sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" << std::endl; +#else + sif::printError("pst::pollingSequenceInitDefault: Sequence invalid!"); #endif return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/tests/user/testcfg/testcfg.mk b/tests/user/testcfg/testcfg.mk deleted file mode 100644 index fca2f7327..000000000 --- a/tests/user/testcfg/testcfg.mk +++ /dev/null @@ -1,8 +0,0 @@ -CXXSRC += $(wildcard $(CURRENTPATH)/cdatapool/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/ipc/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/objects/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/pollingsequence/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp) - -INCLUDES += $(CURRENTPATH) diff --git a/tests/user/unittest/core/CatchFactory.cpp b/tests/user/unittest/core/CatchFactory.cpp index 9afb4fdd4..ff591b8e1 100644 --- a/tests/user/unittest/core/CatchFactory.cpp +++ b/tests/user/unittest/core/CatchFactory.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include