From c2b8507d2947c48e2a2cd19b71640471f436bc5c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 5 Jul 2021 12:09:14 +0200 Subject: [PATCH 1/7] small tweak --- timemanager/CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/timemanager/CMakeLists.txt b/timemanager/CMakeLists.txt index 70dd41fa..00467772 100644 --- a/timemanager/CMakeLists.txt +++ b/timemanager/CMakeLists.txt @@ -1,9 +1,8 @@ -target_sources(${LIB_FSFW_NAME} - PRIVATE - CCSDSTime.cpp - Countdown.cpp - Stopwatch.cpp - TimeMessage.cpp - TimeStamper.cpp - ClockCommon.cpp +target_sources(${LIB_FSFW_NAME} PRIVATE + CCSDSTime.cpp + Countdown.cpp + Stopwatch.cpp + TimeMessage.cpp + TimeStamper.cpp + ClockCommon.cpp ) From eef2fd3b7ac764f06ed5d9a3c97c894d92a515fa Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 8 Jul 2021 12:22:25 +0200 Subject: [PATCH 2/7] minor tweaks --- memory/HasFileSystemIF.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/memory/HasFileSystemIF.h b/memory/HasFileSystemIF.h index 73c93410..ff4cbc9c 100644 --- a/memory/HasFileSystemIF.h +++ b/memory/HasFileSystemIF.h @@ -36,9 +36,8 @@ public: //! [EXPORT] : P1: Sequence number missing static constexpr ReturnValue_t SEQUENCE_PACKET_MISSING_READ = MAKE_RETURN_CODE(16); - - virtual ~HasFileSystemIF() {} + /** * Function to get the MessageQueueId_t of the implementing object * @return MessageQueueId_t of the object From 323577cdc69ee2d863e6e61cebd71a8aa75c6d2b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Jul 2021 17:23:03 +0200 Subject: [PATCH 3/7] file system API update Added functions to create and remove folders --- memory/HasFileSystemIF.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/memory/HasFileSystemIF.h b/memory/HasFileSystemIF.h index ff4cbc9c..de7bd947 100644 --- a/memory/HasFileSystemIF.h +++ b/memory/HasFileSystemIF.h @@ -45,7 +45,7 @@ public: virtual MessageQueueId_t getCommandQueue() const = 0; /** - * Generic function to append to file. + * @brief Generic function to append to file. * @param dirname Directory of the file * @param filename The filename of the file * @param data The data to write to the file @@ -62,12 +62,12 @@ public: uint16_t packetNumber, void* args = nullptr) = 0; /** - * Generic function to create a new file. + * @brief Generic function to create a new file. * @param repositoryPath * @param filename * @param data * @param size - * @param args Any other arguments which an implementation might require. + * @param args Any other arguments which an implementation might require * @return */ virtual ReturnValue_t createFile(const char* repositoryPath, @@ -75,14 +75,29 @@ public: size_t size = 0, void* args = nullptr) = 0; /** - * Generic function to delete a file. + * @brief Generic function to delete a file. * @param repositoryPath * @param filename - * @param args + * @param args Any other arguments which an implementation might require * @return */ virtual ReturnValue_t deleteFile(const char* repositoryPath, const char* filename, void* args = nullptr) = 0; + + /** + * @brief Generic function to create a directory + * @param repositoryPath + * @param args Any other arguments which an implementation might require + * @return + */ + virtual ReturnValue_t createDirectory(const char* repositoryPath, void* args = nullptr) = 0; + + /** + * @brief Generic function to remove a directory + * @param repositoryPath + * @param args Any other arguments which an implementation might require + */ + virtual ReturnValue_t removeDirectory(const char* repositoryPath, void* args = nullptr) = 0; }; From da8a4470734808bed4d872e47c192af694382c41 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 12 Jul 2021 17:39:15 +0200 Subject: [PATCH 4/7] delete directory: recursive option --- memory/GenericFileSystemMessage.cpp | 9 ++++++++- memory/GenericFileSystemMessage.h | 4 +++- memory/HasFileSystemIF.h | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/memory/GenericFileSystemMessage.cpp b/memory/GenericFileSystemMessage.cpp index b0e1a9ec..c35ead3c 100644 --- a/memory/GenericFileSystemMessage.cpp +++ b/memory/GenericFileSystemMessage.cpp @@ -34,8 +34,9 @@ void GenericFileSystemMessage::setReportFileAttributesReply(CommandMessage *mess } void GenericFileSystemMessage::setDeleteDirectoryCommand(CommandMessage* message, - store_address_t storeId) { + store_address_t storeId, bool deleteRecursively) { message->setCommand(CMD_DELETE_DIRECTORY); + message->setParameter(deleteRecursively); message->setParameter2(storeId.raw); } @@ -133,6 +134,12 @@ bool GenericFileSystemMessage::getReadReply(const CommandMessage *message, return message->getParameter(); } +store_address_t GenericFileSystemMessage::getDeleteDirectoryCommand(const CommandMessage *message, + bool &deleteRecursively) { + deleteRecursively = message->getParameter(); + return getStoreId(message); +} + ReturnValue_t GenericFileSystemMessage::clear(CommandMessage* message) { switch(message->getCommand()) { case(CMD_CREATE_FILE): diff --git a/memory/GenericFileSystemMessage.h b/memory/GenericFileSystemMessage.h index 6351dab9..fcd2075d 100644 --- a/memory/GenericFileSystemMessage.h +++ b/memory/GenericFileSystemMessage.h @@ -79,7 +79,9 @@ public: static void setCreateDirectoryCommand(CommandMessage* message, store_address_t storeId); static void setDeleteDirectoryCommand(CommandMessage* message, - store_address_t storeId); + store_address_t storeId, bool deleteRecursively); + static store_address_t getDeleteDirectoryCommand(const CommandMessage* message, + bool& deleteRecursively); static void setSuccessReply(CommandMessage* message); static void setFailureReply(CommandMessage* message, diff --git a/memory/HasFileSystemIF.h b/memory/HasFileSystemIF.h index de7bd947..ec941f59 100644 --- a/memory/HasFileSystemIF.h +++ b/memory/HasFileSystemIF.h @@ -97,7 +97,8 @@ public: * @param repositoryPath * @param args Any other arguments which an implementation might require */ - virtual ReturnValue_t removeDirectory(const char* repositoryPath, void* args = nullptr) = 0; + virtual ReturnValue_t removeDirectory(const char* repositoryPath, + bool deleteRecurively = false, void* args = nullptr) = 0; }; From a3e6b1018b88f6e1e848f49e8f566026e88b98e8 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 14 Jul 2021 18:05:53 +0200 Subject: [PATCH 5/7] deleted .mk file --- misc/defaultcfg/fsfwconfig/fsfwconfig.mk | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 misc/defaultcfg/fsfwconfig/fsfwconfig.mk diff --git a/misc/defaultcfg/fsfwconfig/fsfwconfig.mk b/misc/defaultcfg/fsfwconfig/fsfwconfig.mk deleted file mode 100644 index 51543eba..00000000 --- a/misc/defaultcfg/fsfwconfig/fsfwconfig.mk +++ /dev/null @@ -1,15 +0,0 @@ -CXXSRC += $(wildcard $(CURRENTPATH)/ipc/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/objects/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/pollingsequence/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/events/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/tmtc/*.cpp) -CXXSRC += $(wildcard $(CURRENTPATH)/devices/*.cpp) - -INCLUDES += $(CURRENTPATH) -INCLUDES += $(CURRENTPATH)/objects -INCLUDES += $(CURRENTPATH)/returnvalues -INCLUDES += $(CURRENTPATH)/tmtc -INCLUDES += $(CURRENTPATH)/events -INCLUDES += $(CURRENTPATH)/devices -INCLUDES += $(CURRENTPATH)/pollingsequence -INCLUDES += $(CURRENTPATH)/ipc From 243cf42dc4c2650f37cdbbb34acf6f6affc793d2 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Jul 2021 18:43:16 +0200 Subject: [PATCH 6/7] added hal subfolder --- CMakeLists.txt | 1 + hal/CMakeLists.txt | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f48047c..5ea8c9b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,6 +86,7 @@ message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.") add_subdirectory(src) add_subdirectory(tests) +add_subdirectory(hal) add_subdirectory(contrib) # The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it. diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt index 24d7dac3..070b9fbc 100644 --- a/hal/CMakeLists.txt +++ b/hal/CMakeLists.txt @@ -5,9 +5,7 @@ find_library(LIB_FSFW_NAME fsfw REQUIRED) option(FSFW_HAL_ADD_LINUX "Add the Linux HAL to the sources. Required gpiod library" OFF) option(FSFW_HAL_ADD_RASPBERRY_PI "Add Raspberry Pi specific code to the sources" OFF) - option(FSFW_HAL_ADD_STM32H7 "Add the STM32H7 HAL to the sources" OFF) - option(FSFW_HAL_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON) set(LIB_FSFW_HAL_NAME fsfw_hal) From e2da68795b0163d05c20891bbf0a18803e385b56 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 15 Jul 2021 18:53:59 +0200 Subject: [PATCH 7/7] hal integration done --- hal/CMakeLists.txt | 49 ++----------------- hal/inc/CMakeLists.txt | 7 +++ .../fsfw/{ => hal}/common/gpio/GpioCookie.h | 0 hal/inc/fsfw/{ => hal}/common/gpio/GpioIF.h | 0 .../{ => hal}/common/gpio/gpioDefinitions.h | 0 hal/inc/fsfw/{ => hal}/common/spi/spiCommon.h | 0 .../devicehandlers/GyroL3GD20Handler.h | 0 .../devicedefinitions/GyroL3GD20Definitions.h | 0 hal/inc/fsfw/{ => hal}/linux/UnixFileGuard.h | 0 .../{ => hal}/linux/gpio/LinuxLibgpioIF.h | 0 hal/inc/fsfw/{ => hal}/linux/i2c/I2cComIF.h | 0 hal/inc/fsfw/{ => hal}/linux/i2c/I2cCookie.h | 0 hal/inc/fsfw/{ => hal}/linux/rpi/GpioRPi.h | 0 hal/inc/fsfw/{ => hal}/linux/spi/SpiComIF.h | 0 hal/inc/fsfw/{ => hal}/linux/spi/SpiCookie.h | 0 .../fsfw/{ => hal}/linux/spi/spiDefinitions.h | 0 hal/inc/fsfw/{ => hal}/linux/uart/UartComIF.h | 0 .../fsfw/{ => hal}/linux/uart/UartCookie.h | 0 hal/inc/fsfw/{ => hal}/linux/utility.h | 0 .../stm32h7/devicetest/GyroL3GD20H.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/dma.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/gpio/gpio.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/interrupts.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/spi/SpiComIF.h | 0 .../fsfw/{ => hal}/stm32h7/spi/SpiCookie.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/spi/mspInit.h | 0 hal/inc/fsfw/{ => hal}/stm32h7/spi/spiCore.h | 0 .../{ => hal}/stm32h7/spi/spiDefinitions.h | 0 .../{ => hal}/stm32h7/spi/spiInterrupts.h | 0 .../{ => hal}/stm32h7/spi/stm32h743ziSpi.h | 0 hal/src/CMakeLists.txt | 10 ++++ hal/src/common/CMakeLists.txt | 1 + hal/src/common/gpio/CMakeLists.txt | 2 +- hal/src/common/gpio/GpioCookie.cpp | 2 +- hal/src/devicehandlers/CMakeLists.txt | 2 +- hal/src/devicehandlers/GyroL3GD20Handler.cpp | 4 +- hal/src/linux/CMakeLists.txt | 2 +- hal/src/linux/UnixFileGuard.cpp | 2 +- hal/src/linux/gpio/CMakeLists.txt | 4 +- hal/src/linux/gpio/LinuxLibgpioIF.cpp | 6 +-- hal/src/linux/i2c/CMakeLists.txt | 2 +- hal/src/linux/i2c/I2cComIF.cpp | 8 +-- hal/src/linux/i2c/I2cCookie.cpp | 2 +- hal/src/linux/rpi/CMakeLists.txt | 2 +- hal/src/linux/rpi/GpioRPi.cpp | 7 +-- hal/src/linux/spi/CMakeLists.txt | 2 +- hal/src/linux/spi/SpiComIF.cpp | 10 ++-- hal/src/linux/spi/SpiCookie.cpp | 2 +- hal/src/linux/uart/UartComIF.cpp | 2 +- hal/src/linux/uart/UartCookie.cpp | 2 +- hal/src/stm32h7/CMakeLists.txt | 2 +- hal/src/stm32h7/devicetest/CMakeLists.txt | 2 +- hal/src/stm32h7/gpio/CMakeLists.txt | 2 +- hal/src/stm32h7/i2c/CMakeLists.txt | 2 +- hal/src/stm32h7/spi/CMakeLists.txt | 2 +- hal/src/stm32h7/uart/CMakeLists.txt | 2 +- 56 files changed, 61 insertions(+), 81 deletions(-) create mode 100644 hal/inc/CMakeLists.txt rename hal/inc/fsfw/{ => hal}/common/gpio/GpioCookie.h (100%) rename hal/inc/fsfw/{ => hal}/common/gpio/GpioIF.h (100%) rename hal/inc/fsfw/{ => hal}/common/gpio/gpioDefinitions.h (100%) rename hal/inc/fsfw/{ => hal}/common/spi/spiCommon.h (100%) rename hal/inc/fsfw/{ => hal}/devicehandlers/GyroL3GD20Handler.h (100%) rename hal/inc/fsfw/{ => hal}/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h (100%) rename hal/inc/fsfw/{ => hal}/linux/UnixFileGuard.h (100%) rename hal/inc/fsfw/{ => hal}/linux/gpio/LinuxLibgpioIF.h (100%) rename hal/inc/fsfw/{ => hal}/linux/i2c/I2cComIF.h (100%) rename hal/inc/fsfw/{ => hal}/linux/i2c/I2cCookie.h (100%) rename hal/inc/fsfw/{ => hal}/linux/rpi/GpioRPi.h (100%) rename hal/inc/fsfw/{ => hal}/linux/spi/SpiComIF.h (100%) rename hal/inc/fsfw/{ => hal}/linux/spi/SpiCookie.h (100%) rename hal/inc/fsfw/{ => hal}/linux/spi/spiDefinitions.h (100%) rename hal/inc/fsfw/{ => hal}/linux/uart/UartComIF.h (100%) rename hal/inc/fsfw/{ => hal}/linux/uart/UartCookie.h (100%) rename hal/inc/fsfw/{ => hal}/linux/utility.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/devicetest/GyroL3GD20H.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/dma.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/gpio/gpio.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/interrupts.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/SpiComIF.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/SpiCookie.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/mspInit.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/spiCore.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/spiDefinitions.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/spiInterrupts.h (100%) rename hal/inc/fsfw/{ => hal}/stm32h7/spi/stm32h743ziSpi.h (100%) create mode 100644 hal/src/CMakeLists.txt create mode 100644 hal/src/common/CMakeLists.txt diff --git a/hal/CMakeLists.txt b/hal/CMakeLists.txt index 070b9fbc..018018d0 100644 --- a/hal/CMakeLists.txt +++ b/hal/CMakeLists.txt @@ -12,26 +12,12 @@ set(LIB_FSFW_HAL_NAME fsfw_hal) set(LINUX_HAL_PATH_NAME linux) set(STM32H7_PATH_NAME stm32h7) -add_library(${LIB_FSFW_HAL_NAME}) - if(NOT LIB_FSFW_NAME) message(ERROR "LIB_FSFW_NAME needs to be set as a linkable target") endif() -add_subdirectory(devicehandlers) -add_subdirectory(common) - -if(FSFW_HAL_ADD_LINUX) - add_subdirectory(${LINUX_HAL_PATH_NAME}) -endif() - -if(FSFW_HAL_ADD_STM32H7) - add_subdirectory(${STM32H7_PATH_NAME}) -endif() - -target_link_libraries(${LIB_FSFW_HAL_NAME} PRIVATE - ${LIB_FSFW_NAME} -) +add_subdirectory(src) +add_subdirectory(inc) foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS}) if(IS_ABSOLUTE ${INCLUDE_PATH}) @@ -48,40 +34,15 @@ foreach(INCLUDE_PATH ${FSFW_HAL_ADDITIONAL_INC_PATHS}) list(APPEND FSFW_HAL_ADD_INC_PATHS_ABS ${CURR_ABS_INC_PATH}) endforeach() -target_include_directories(${LIB_FSFW_HAL_NAME} PRIVATE +target_include_directories(${LIB_FSFW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_HAL_ADD_INC_PATHS_ABS} ) -target_compile_definitions(${LIB_FSFW_HAL_NAME} PRIVATE +target_compile_definitions(${LIB_FSFW_NAME} PRIVATE ${FSFW_HAL_DEFINES} ) -target_link_libraries(${LIB_FSFW_HAL_NAME} PRIVATE +target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${FSFW_HAL_LINK_LIBS} ) - -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - if(NOT DEFINED FSFW_WARNING_FLAGS) - set(FSFW_WARNING_FLAGS - -Wall - -Wextra - -Wimplicit-fallthrough=1 - -Wno-unused-parameter - ) - endif() - - target_compile_options(${LIB_FSFW_NAME} PRIVATE - "-ffunction-sections" - "-fdata-sections" - ) - - target_link_options(${LIB_FSFW_NAME} PRIVATE - "Wl,--gc-sections" - ) - - if(FSFW_HAL_WARNING_SHADOW_LOCAL_GCC) - list(APPEND WARNING_FLAGS "-Wshadow=local") - endif() - -endif() diff --git a/hal/inc/CMakeLists.txt b/hal/inc/CMakeLists.txt new file mode 100644 index 00000000..abf6a3d2 --- /dev/null +++ b/hal/inc/CMakeLists.txt @@ -0,0 +1,7 @@ +target_include_directories(${LIB_FSFW_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_include_directories(${LIB_FSFW_NAME} INTERFACE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/hal/inc/fsfw/common/gpio/GpioCookie.h b/hal/inc/fsfw/hal/common/gpio/GpioCookie.h similarity index 100% rename from hal/inc/fsfw/common/gpio/GpioCookie.h rename to hal/inc/fsfw/hal/common/gpio/GpioCookie.h diff --git a/hal/inc/fsfw/common/gpio/GpioIF.h b/hal/inc/fsfw/hal/common/gpio/GpioIF.h similarity index 100% rename from hal/inc/fsfw/common/gpio/GpioIF.h rename to hal/inc/fsfw/hal/common/gpio/GpioIF.h diff --git a/hal/inc/fsfw/common/gpio/gpioDefinitions.h b/hal/inc/fsfw/hal/common/gpio/gpioDefinitions.h similarity index 100% rename from hal/inc/fsfw/common/gpio/gpioDefinitions.h rename to hal/inc/fsfw/hal/common/gpio/gpioDefinitions.h diff --git a/hal/inc/fsfw/common/spi/spiCommon.h b/hal/inc/fsfw/hal/common/spi/spiCommon.h similarity index 100% rename from hal/inc/fsfw/common/spi/spiCommon.h rename to hal/inc/fsfw/hal/common/spi/spiCommon.h diff --git a/hal/inc/fsfw/devicehandlers/GyroL3GD20Handler.h b/hal/inc/fsfw/hal/devicehandlers/GyroL3GD20Handler.h similarity index 100% rename from hal/inc/fsfw/devicehandlers/GyroL3GD20Handler.h rename to hal/inc/fsfw/hal/devicehandlers/GyroL3GD20Handler.h diff --git a/hal/inc/fsfw/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h b/hal/inc/fsfw/hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h similarity index 100% rename from hal/inc/fsfw/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h rename to hal/inc/fsfw/hal/devicehandlers/devicedefinitions/GyroL3GD20Definitions.h diff --git a/hal/inc/fsfw/linux/UnixFileGuard.h b/hal/inc/fsfw/hal/linux/UnixFileGuard.h similarity index 100% rename from hal/inc/fsfw/linux/UnixFileGuard.h rename to hal/inc/fsfw/hal/linux/UnixFileGuard.h diff --git a/hal/inc/fsfw/linux/gpio/LinuxLibgpioIF.h b/hal/inc/fsfw/hal/linux/gpio/LinuxLibgpioIF.h similarity index 100% rename from hal/inc/fsfw/linux/gpio/LinuxLibgpioIF.h rename to hal/inc/fsfw/hal/linux/gpio/LinuxLibgpioIF.h diff --git a/hal/inc/fsfw/linux/i2c/I2cComIF.h b/hal/inc/fsfw/hal/linux/i2c/I2cComIF.h similarity index 100% rename from hal/inc/fsfw/linux/i2c/I2cComIF.h rename to hal/inc/fsfw/hal/linux/i2c/I2cComIF.h diff --git a/hal/inc/fsfw/linux/i2c/I2cCookie.h b/hal/inc/fsfw/hal/linux/i2c/I2cCookie.h similarity index 100% rename from hal/inc/fsfw/linux/i2c/I2cCookie.h rename to hal/inc/fsfw/hal/linux/i2c/I2cCookie.h diff --git a/hal/inc/fsfw/linux/rpi/GpioRPi.h b/hal/inc/fsfw/hal/linux/rpi/GpioRPi.h similarity index 100% rename from hal/inc/fsfw/linux/rpi/GpioRPi.h rename to hal/inc/fsfw/hal/linux/rpi/GpioRPi.h diff --git a/hal/inc/fsfw/linux/spi/SpiComIF.h b/hal/inc/fsfw/hal/linux/spi/SpiComIF.h similarity index 100% rename from hal/inc/fsfw/linux/spi/SpiComIF.h rename to hal/inc/fsfw/hal/linux/spi/SpiComIF.h diff --git a/hal/inc/fsfw/linux/spi/SpiCookie.h b/hal/inc/fsfw/hal/linux/spi/SpiCookie.h similarity index 100% rename from hal/inc/fsfw/linux/spi/SpiCookie.h rename to hal/inc/fsfw/hal/linux/spi/SpiCookie.h diff --git a/hal/inc/fsfw/linux/spi/spiDefinitions.h b/hal/inc/fsfw/hal/linux/spi/spiDefinitions.h similarity index 100% rename from hal/inc/fsfw/linux/spi/spiDefinitions.h rename to hal/inc/fsfw/hal/linux/spi/spiDefinitions.h diff --git a/hal/inc/fsfw/linux/uart/UartComIF.h b/hal/inc/fsfw/hal/linux/uart/UartComIF.h similarity index 100% rename from hal/inc/fsfw/linux/uart/UartComIF.h rename to hal/inc/fsfw/hal/linux/uart/UartComIF.h diff --git a/hal/inc/fsfw/linux/uart/UartCookie.h b/hal/inc/fsfw/hal/linux/uart/UartCookie.h similarity index 100% rename from hal/inc/fsfw/linux/uart/UartCookie.h rename to hal/inc/fsfw/hal/linux/uart/UartCookie.h diff --git a/hal/inc/fsfw/linux/utility.h b/hal/inc/fsfw/hal/linux/utility.h similarity index 100% rename from hal/inc/fsfw/linux/utility.h rename to hal/inc/fsfw/hal/linux/utility.h diff --git a/hal/inc/fsfw/stm32h7/devicetest/GyroL3GD20H.h b/hal/inc/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h similarity index 100% rename from hal/inc/fsfw/stm32h7/devicetest/GyroL3GD20H.h rename to hal/inc/fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h diff --git a/hal/inc/fsfw/stm32h7/dma.h b/hal/inc/fsfw/hal/stm32h7/dma.h similarity index 100% rename from hal/inc/fsfw/stm32h7/dma.h rename to hal/inc/fsfw/hal/stm32h7/dma.h diff --git a/hal/inc/fsfw/stm32h7/gpio/gpio.h b/hal/inc/fsfw/hal/stm32h7/gpio/gpio.h similarity index 100% rename from hal/inc/fsfw/stm32h7/gpio/gpio.h rename to hal/inc/fsfw/hal/stm32h7/gpio/gpio.h diff --git a/hal/inc/fsfw/stm32h7/interrupts.h b/hal/inc/fsfw/hal/stm32h7/interrupts.h similarity index 100% rename from hal/inc/fsfw/stm32h7/interrupts.h rename to hal/inc/fsfw/hal/stm32h7/interrupts.h diff --git a/hal/inc/fsfw/stm32h7/spi/SpiComIF.h b/hal/inc/fsfw/hal/stm32h7/spi/SpiComIF.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/SpiComIF.h rename to hal/inc/fsfw/hal/stm32h7/spi/SpiComIF.h diff --git a/hal/inc/fsfw/stm32h7/spi/SpiCookie.h b/hal/inc/fsfw/hal/stm32h7/spi/SpiCookie.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/SpiCookie.h rename to hal/inc/fsfw/hal/stm32h7/spi/SpiCookie.h diff --git a/hal/inc/fsfw/stm32h7/spi/mspInit.h b/hal/inc/fsfw/hal/stm32h7/spi/mspInit.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/mspInit.h rename to hal/inc/fsfw/hal/stm32h7/spi/mspInit.h diff --git a/hal/inc/fsfw/stm32h7/spi/spiCore.h b/hal/inc/fsfw/hal/stm32h7/spi/spiCore.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/spiCore.h rename to hal/inc/fsfw/hal/stm32h7/spi/spiCore.h diff --git a/hal/inc/fsfw/stm32h7/spi/spiDefinitions.h b/hal/inc/fsfw/hal/stm32h7/spi/spiDefinitions.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/spiDefinitions.h rename to hal/inc/fsfw/hal/stm32h7/spi/spiDefinitions.h diff --git a/hal/inc/fsfw/stm32h7/spi/spiInterrupts.h b/hal/inc/fsfw/hal/stm32h7/spi/spiInterrupts.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/spiInterrupts.h rename to hal/inc/fsfw/hal/stm32h7/spi/spiInterrupts.h diff --git a/hal/inc/fsfw/stm32h7/spi/stm32h743ziSpi.h b/hal/inc/fsfw/hal/stm32h7/spi/stm32h743ziSpi.h similarity index 100% rename from hal/inc/fsfw/stm32h7/spi/stm32h743ziSpi.h rename to hal/inc/fsfw/hal/stm32h7/spi/stm32h743ziSpi.h diff --git a/hal/src/CMakeLists.txt b/hal/src/CMakeLists.txt new file mode 100644 index 00000000..fcd81389 --- /dev/null +++ b/hal/src/CMakeLists.txt @@ -0,0 +1,10 @@ +add_subdirectory(devicehandlers) +add_subdirectory(common) + +if(FSFW_HAL_ADD_LINUX) + add_subdirectory(${LINUX_HAL_PATH_NAME}) +endif() + +if(FSFW_HAL_ADD_STM32H7) + add_subdirectory(${STM32H7_PATH_NAME}) +endif() diff --git a/hal/src/common/CMakeLists.txt b/hal/src/common/CMakeLists.txt new file mode 100644 index 00000000..f1cfec52 --- /dev/null +++ b/hal/src/common/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(gpio) diff --git a/hal/src/common/gpio/CMakeLists.txt b/hal/src/common/gpio/CMakeLists.txt index 9dbcdf9d..098c05fa 100644 --- a/hal/src/common/gpio/CMakeLists.txt +++ b/hal/src/common/gpio/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE GpioCookie.cpp ) \ No newline at end of file diff --git a/hal/src/common/gpio/GpioCookie.cpp b/hal/src/common/gpio/GpioCookie.cpp index da765cea..31832070 100644 --- a/hal/src/common/gpio/GpioCookie.cpp +++ b/hal/src/common/gpio/GpioCookie.cpp @@ -1,4 +1,4 @@ -#include "GpioCookie.h" +#include "fsfw/hal/common/gpio/GpioCookie.h" #include "fsfw/serviceinterface/ServiceInterface.h" GpioCookie::GpioCookie() { diff --git a/hal/src/devicehandlers/CMakeLists.txt b/hal/src/devicehandlers/CMakeLists.txt index 1cde7e49..cf542d8d 100644 --- a/hal/src/devicehandlers/CMakeLists.txt +++ b/hal/src/devicehandlers/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE GyroL3GD20Handler.cpp ) diff --git a/hal/src/devicehandlers/GyroL3GD20Handler.cpp b/hal/src/devicehandlers/GyroL3GD20Handler.cpp index 79cbe435..11f7e92d 100644 --- a/hal/src/devicehandlers/GyroL3GD20Handler.cpp +++ b/hal/src/devicehandlers/GyroL3GD20Handler.cpp @@ -1,6 +1,6 @@ -#include "GyroL3GD20Handler.h" +#include "fsfw/hal/devicehandlers/GyroL3GD20Handler.h" -#include +#include "fsfw/datapool/PoolReadGuard.h" GyroHandlerL3GD20H::GyroHandlerL3GD20H(object_id_t objectId, object_id_t deviceCommunication, CookieIF *comCookie): diff --git a/hal/src/linux/CMakeLists.txt b/hal/src/linux/CMakeLists.txt index 6c2ec77e..5944b0e5 100644 --- a/hal/src/linux/CMakeLists.txt +++ b/hal/src/linux/CMakeLists.txt @@ -2,7 +2,7 @@ if(FSFW_HAL_ADD_RASPBERRY_PI) add_subdirectory(rpi) endif() -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE UnixFileGuard.cpp utility.cpp ) diff --git a/hal/src/linux/UnixFileGuard.cpp b/hal/src/linux/UnixFileGuard.cpp index 3aec58d8..c47e35b1 100644 --- a/hal/src/linux/UnixFileGuard.cpp +++ b/hal/src/linux/UnixFileGuard.cpp @@ -1,4 +1,4 @@ -#include "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/linux/gpio/CMakeLists.txt b/hal/src/linux/gpio/CMakeLists.txt index b2041b40..7083f70d 100644 --- a/hal/src/linux/gpio/CMakeLists.txt +++ b/hal/src/linux/gpio/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE LinuxLibgpioIF.cpp ) @@ -7,6 +7,6 @@ target_sources(${LIB_FSFW_HAL_NAME} PRIVATE # to install the package before syncing the sysroot to your host computer. find_library(LIB_GPIO gpiod REQUIRED) -target_link_libraries(${LIB_FSFW_HAL_NAME} PRIVATE +target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_GPIO} ) \ No newline at end of file diff --git a/hal/src/linux/gpio/LinuxLibgpioIF.cpp b/hal/src/linux/gpio/LinuxLibgpioIF.cpp index cfdac2bf..98e02796 100644 --- a/hal/src/linux/gpio/LinuxLibgpioIF.cpp +++ b/hal/src/linux/gpio/LinuxLibgpioIF.cpp @@ -1,6 +1,6 @@ -#include "LinuxLibgpioIF.h" -#include -#include +#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/linux/i2c/CMakeLists.txt b/hal/src/linux/i2c/CMakeLists.txt index 0e50313c..3eb0882c 100644 --- a/hal/src/linux/i2c/CMakeLists.txt +++ b/hal/src/linux/i2c/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${LIB_FSFW_HAL_NAME} PUBLIC +target_sources(${LIB_FSFW_NAME} PUBLIC I2cComIF.cpp I2cCookie.cpp ) diff --git a/hal/src/linux/i2c/I2cComIF.cpp b/hal/src/linux/i2c/I2cComIF.cpp index aa336c7b..d756e75e 100644 --- a/hal/src/linux/i2c/I2cComIF.cpp +++ b/hal/src/linux/i2c/I2cComIF.cpp @@ -1,8 +1,8 @@ -#include "I2cComIF.h" -#include "../utility.h" -#include "../UnixFileGuard.h" +#include "fsfw/hal/linux/i2c/I2cComIF.h" +#include "fsfw/hal/linux/utility.h" +#include "fsfw/hal/linux/UnixFileGuard.h" -#include +#include "fsfw/serviceinterface/ServiceInterface.h" #include #include diff --git a/hal/src/linux/i2c/I2cCookie.cpp b/hal/src/linux/i2c/I2cCookie.cpp index fe0f3f92..fd0f654d 100644 --- a/hal/src/linux/i2c/I2cCookie.cpp +++ b/hal/src/linux/i2c/I2cCookie.cpp @@ -1,4 +1,4 @@ -#include "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/linux/rpi/CMakeLists.txt b/hal/src/linux/rpi/CMakeLists.txt index 053583aa..47be218c 100644 --- a/hal/src/linux/rpi/CMakeLists.txt +++ b/hal/src/linux/rpi/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE GpioRPi.cpp ) \ No newline at end of file diff --git a/hal/src/linux/rpi/GpioRPi.cpp b/hal/src/linux/rpi/GpioRPi.cpp index 64b6fcaa..277a9fb2 100644 --- a/hal/src/linux/rpi/GpioRPi.cpp +++ b/hal/src/linux/rpi/GpioRPi.cpp @@ -1,6 +1,7 @@ -#include "GpioRPi.h" -#include "../../common/gpio/GpioCookie.h" -#include +#include "fsfw/FSFW.h" + +#include "fsfw/hal/linux/rpi/GpioRPi.h" +#include "fsfw/hal/common/gpio/GpioCookie.h" #include diff --git a/hal/src/linux/spi/CMakeLists.txt b/hal/src/linux/spi/CMakeLists.txt index 5794547c..404e1f47 100644 --- a/hal/src/linux/spi/CMakeLists.txt +++ b/hal/src/linux/spi/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${LIB_FSFW_HAL_NAME} PUBLIC +target_sources(${LIB_FSFW_NAME} PUBLIC SpiComIF.cpp SpiCookie.cpp ) diff --git a/hal/src/linux/spi/SpiComIF.cpp b/hal/src/linux/spi/SpiComIF.cpp index 9dc44295..f3d8ab09 100644 --- a/hal/src/linux/spi/SpiComIF.cpp +++ b/hal/src/linux/spi/SpiComIF.cpp @@ -1,8 +1,8 @@ -#include "SpiComIF.h" -#include "SpiCookie.h" -#include "../utility.h" -#include "../UnixFileGuard.h" -#include "FSFWConfig.h" +#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 #include diff --git a/hal/src/linux/spi/SpiCookie.cpp b/hal/src/linux/spi/SpiCookie.cpp index e34ea36a..a74bc419 100644 --- a/hal/src/linux/spi/SpiCookie.cpp +++ b/hal/src/linux/spi/SpiCookie.cpp @@ -1,4 +1,4 @@ -#include "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/linux/uart/UartComIF.cpp b/hal/src/linux/uart/UartComIF.cpp index c84affa9..e5fc90c3 100644 --- a/hal/src/linux/uart/UartComIF.cpp +++ b/hal/src/linux/uart/UartComIF.cpp @@ -1,4 +1,4 @@ -#include "UartComIF.h" +#include "fsfw/hal/linux/uart/UartComIF.h" #include "OBSWConfig.h" #include "fsfw/serviceinterface/ServiceInterface.h" diff --git a/hal/src/linux/uart/UartCookie.cpp b/hal/src/linux/uart/UartCookie.cpp index 2e9cede9..bfd091a8 100644 --- a/hal/src/linux/uart/UartCookie.cpp +++ b/hal/src/linux/uart/UartCookie.cpp @@ -1,4 +1,4 @@ -#include "UartCookie.h" +#include "fsfw/hal/linux/uart/UartCookie.h" #include diff --git a/hal/src/stm32h7/CMakeLists.txt b/hal/src/stm32h7/CMakeLists.txt index 63c13734..bae3b1ac 100644 --- a/hal/src/stm32h7/CMakeLists.txt +++ b/hal/src/stm32h7/CMakeLists.txt @@ -2,6 +2,6 @@ add_subdirectory(spi) add_subdirectory(gpio) add_subdirectory(devicetest) -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE dma.cpp ) diff --git a/hal/src/stm32h7/devicetest/CMakeLists.txt b/hal/src/stm32h7/devicetest/CMakeLists.txt index 1ee43134..7bd4c3a9 100644 --- a/hal/src/stm32h7/devicetest/CMakeLists.txt +++ b/hal/src/stm32h7/devicetest/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE GyroL3GD20H.cpp ) \ No newline at end of file diff --git a/hal/src/stm32h7/gpio/CMakeLists.txt b/hal/src/stm32h7/gpio/CMakeLists.txt index 66027dd9..35245b25 100644 --- a/hal/src/stm32h7/gpio/CMakeLists.txt +++ b/hal/src/stm32h7/gpio/CMakeLists.txt @@ -1,3 +1,3 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE gpio.cpp ) diff --git a/hal/src/stm32h7/i2c/CMakeLists.txt b/hal/src/stm32h7/i2c/CMakeLists.txt index aa3194a9..5ecb0990 100644 --- a/hal/src/stm32h7/i2c/CMakeLists.txt +++ b/hal/src/stm32h7/i2c/CMakeLists.txt @@ -1,2 +1,2 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE ) diff --git a/hal/src/stm32h7/spi/CMakeLists.txt b/hal/src/stm32h7/spi/CMakeLists.txt index fb4f6474..e28c35aa 100644 --- a/hal/src/stm32h7/spi/CMakeLists.txt +++ b/hal/src/stm32h7/spi/CMakeLists.txt @@ -1,4 +1,4 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE spiCore.cpp spiDefinitions.cpp spiInterrupts.cpp diff --git a/hal/src/stm32h7/uart/CMakeLists.txt b/hal/src/stm32h7/uart/CMakeLists.txt index aa3194a9..5ecb0990 100644 --- a/hal/src/stm32h7/uart/CMakeLists.txt +++ b/hal/src/stm32h7/uart/CMakeLists.txt @@ -1,2 +1,2 @@ -target_sources(${LIB_FSFW_HAL_NAME} PRIVATE +target_sources(${LIB_FSFW_NAME} PRIVATE )