apply new auto-formatter on all files
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-05-17 13:40:19 +02:00
parent e2cfce634b
commit 8a5090b8ee
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
57 changed files with 634 additions and 797 deletions

View File

@ -1,12 +1,12 @@
################################################################################
# ##############################################################################
# CMake support for the EIVE OBSW
#
# Author: R. Mueller
################################################################################
# ##############################################################################
################################################################################
# ##############################################################################
# Pre-Project preparation
################################################################################
# ##############################################################################
cmake_minimum_required(VERSION 3.13)
set(OBSW_VERSION_MAJOR_IF_GIT_FAILS 0)
@ -15,17 +15,23 @@ set(OBSW_VERSION_REVISION_IF_GIT_FAILS 0)
# set(CMAKE_VERBOSE TRUE)
option(EIVE_HARDCODED_TOOLCHAIN_FILE "\
option(
EIVE_HARDCODED_TOOLCHAIN_FILE
"\
For Linux Board Target BSPs, a default toolchain file will be set. Should be set to OFF \
if a different toolchain file is set externally" ON
)
if a different toolchain file is set externally"
ON)
if(NOT FSFW_OSAL)
set(FSFW_OSAL linux CACHE STRING "OS for the FSFW.")
set(FSFW_OSAL
linux
CACHE STRING "OS for the FSFW.")
endif()
if(TGT_BSP)
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
if(TGT_BSP MATCHES "arm/q7s"
OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack")
option(LINUX_CROSS_COMPILE ON)
endif()
if(TGT_BSP MATCHES "arm/raspberrypi" OR TGT_BSP MATCHES "arm/beagleboneblack")
@ -34,9 +40,11 @@ if(TGT_BSP)
option(EIVE_Q7S_EM "Build configuration for the EM" OFF)
option(EIVE_BUILD_GPSD_GPS_HANDLER "Build GPSD dependent GPS Handler" ON)
endif()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" ON)
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
ON)
else()
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name" OFF)
option(EIVE_CREATE_UNIQUE_OBSW_BIN "Append username to generated binary name"
OFF)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
@ -57,38 +65,74 @@ option(EIVE_ADD_ETL_LIB "Add ETL library" ON)
option(EIVE_ADD_JSON_LIB "Add JSON library" ON)
if(EIVE_Q7S_EM)
set(OBSW_Q7S_EM 1 CACHE STRING "Q7S EM configuration")
set(OBSW_Q7S_EM
1
CACHE STRING "Q7S EM configuration")
set(INIT_VAL 0)
else()
set(OBSW_Q7S_EM 0 CACHE STRING "Q7S EM configuration")
set(OBSW_Q7S_EM
0
CACHE STRING "Q7S EM configuration")
set(INIT_VAL 1)
endif()
set(OBSW_ADD_MGT ${INIT_VAL} CACHE STRING "Add MGT module" )
set(OBSW_ADD_BPX_BATTERY_HANDLER ${INIT_VAL} CACHE STRING "Add MGT module")
set(OBSW_ADD_STAR_TRACKER ${INIT_VAL} CACHE STRING "Add Startracker module")
set(OBSW_ADD_SUN_SENSORS ${INIT_VAL} CACHE STRING "Add sun sensor module")
set(OBSW_ADD_SUS_BOARD_ASS ${INIT_VAL} CACHE STRING "Add sun sensor board assembly")
set(OBSW_ADD_ACS_BOARD ${INIT_VAL} CACHE STRING "Add ACS board module")
set(OBSW_ADD_ACS_HANDLERS ${INIT_VAL} CACHE STRING "Add ACS handlers")
set(OBSW_ADD_RTD_DEVICES ${INIT_VAL} CACHE STRING "Add RTD devices")
set(OBSW_ADD_RAD_SENSORS ${INIT_VAL} CACHE STRING "Add Rad Sensor module")
set(OBSW_ADD_PL_PCDU ${INIT_VAL} CACHE STRING "Add Payload PCDU modukle")
set(OBSW_ADD_SYRLINKS ${INIT_VAL} CACHE STRING "Add Syrlinks module")
set(OBSW_ADD_TMP_DEVICES ${INIT_VAL} CACHE STRING "Add TMP devices")
set(OBSW_ADD_GOMSPACE_PCDU ${INIT_VAL} CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_RW ${INIT_VAL} CACHE STRING "Add RW modules")
set(OBSW_ADD_MGT
${INIT_VAL}
CACHE STRING "Add MGT module")
set(OBSW_ADD_BPX_BATTERY_HANDLER
${INIT_VAL}
CACHE STRING "Add MGT module")
set(OBSW_ADD_STAR_TRACKER
${INIT_VAL}
CACHE STRING "Add Startracker module")
set(OBSW_ADD_SUN_SENSORS
${INIT_VAL}
CACHE STRING "Add sun sensor module")
set(OBSW_ADD_SUS_BOARD_ASS
${INIT_VAL}
CACHE STRING "Add sun sensor board assembly")
set(OBSW_ADD_ACS_BOARD
${INIT_VAL}
CACHE STRING "Add ACS board module")
set(OBSW_ADD_ACS_HANDLERS
${INIT_VAL}
CACHE STRING "Add ACS handlers")
set(OBSW_ADD_RTD_DEVICES
${INIT_VAL}
CACHE STRING "Add RTD devices")
set(OBSW_ADD_RAD_SENSORS
${INIT_VAL}
CACHE STRING "Add Rad Sensor module")
set(OBSW_ADD_PL_PCDU
${INIT_VAL}
CACHE STRING "Add Payload PCDU modukle")
set(OBSW_ADD_SYRLINKS
${INIT_VAL}
CACHE STRING "Add Syrlinks module")
set(OBSW_ADD_TMP_DEVICES
${INIT_VAL}
CACHE STRING "Add TMP devices")
set(OBSW_ADD_GOMSPACE_PCDU
${INIT_VAL}
CACHE STRING "Add GomSpace PCDU modules")
set(OBSW_ADD_RW
${INIT_VAL}
CACHE STRING "Add RW modules")
################################################################################
# ##############################################################################
# Pre-Sources preparation
################################################################################
# ##############################################################################
# Version handling
set(GIT_VER_HANDLING_OK FALSE)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
determine_version_with_git("--exclude" "docker_*")
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe")
set(GIT_INFO
${GIT_INFO}
CACHE STRING "Version information retrieved with git describe")
if(GIT_INFO)
set(GIT_INFO ${GIT_INFO} CACHE STRING "Version information retrieved with git describe")
set(GIT_INFO
${GIT_INFO}
CACHE STRING "Version information retrieved with git describe")
list(GET GIT_INFO 1 OBSW_VERSION_MAJOR)
list(GET GIT_INFO 2 OBSW_VERSION_MINOR)
list(GET GIT_INFO 3 OBSW_VERSION_REVISION)
@ -157,12 +201,14 @@ pre_source_hw_os_config()
if(TGT_BSP)
set(LIBGPS_VERSION_MAJOR 3)
# I assume a newer version than 3.17 will be installed on other Linux board than the Q7S
# I assume a newer version than 3.17 will be installed on other Linux board
# than the Q7S
set(LIBGPS_VERSION_MINOR 20)
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack" OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa"
)
if(TGT_BSP MATCHES "arm/q7s"
OR TGT_BSP MATCHES "arm/raspberrypi"
OR TGT_BSP MATCHES "arm/beagleboneblack"
OR TGT_BSP MATCHES "arm/egse"
OR TGT_BSP MATCHES "arm/te0720-1cfa")
find_library(${LIB_GPS} gps)
set(FSFW_CONFIG_PATH "linux/fsfwconfig")
if(NOT BUILD_Q7S_SIMPLE_MODE)
@ -206,7 +252,6 @@ else()
set(FSFW_CONFIG_PATH "${BSP_PATH}/fsfwconfig")
endif()
# Configuration files
configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
@ -220,14 +265,12 @@ endif()
configure_file(${WATCHDOG_PATH}/watchdogConf.h.in watchdogConf.h)
# Set common config path for FSFW
set(FSFW_ADDITIONAL_INC_PATHS
"${COMMON_PATH}/config"
${CMAKE_CURRENT_BINARY_DIR}
)
set(FSFW_ADDITIONAL_INC_PATHS "${COMMON_PATH}/config"
${CMAKE_CURRENT_BINARY_DIR})
################################################################################
# ##############################################################################
# Executable and Sources
################################################################################
# ##############################################################################
# global compiler options need to be set before adding executables
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@ -252,20 +295,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
"-Wcast-qual" # Warn if the constness is cast away
"-Wstringop-overflow=4"
# -Wstack-protector # Emits a few false positives for low level access
# -Wconversion # Creates many false positives
# -Warith-conversion # Use with Wconversion to find more implicit conversions
# -fanalyzer # Should be used to look through problems
# -Wconversion # Creates many false positives -Warith-conversion # Use with
# Wconversion to find more implicit conversions -fanalyzer # Should be used
# to look through problems
)
# Remove unused sections.
add_compile_options(
"-ffunction-sections"
"-fdata-sections"
)
add_compile_options("-ffunction-sections" "-fdata-sections")
# Removed unused sections.
add_link_options(
"-Wl,--gc-sections"
)
add_link_options("-Wl,--gc-sections")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(COMPILER_FLAGS "/permissive-")
@ -287,12 +325,8 @@ else()
endif()
add_subdirectory(${WATCHDOG_PATH})
target_link_libraries(${WATCHDOG_NAME} PUBLIC
${LIB_CXX_FS}
)
target_include_directories(${WATCHDOG_NAME} PUBLIC
${CMAKE_BINARY_DIR}
)
target_link_libraries(${WATCHDOG_NAME} PUBLIC ${LIB_CXX_FS})
target_include_directories(${WATCHDOG_NAME} PUBLIC ${CMAKE_BINARY_DIR})
# unittests
if(NOT TGT_BSP)
@ -302,6 +336,7 @@ else()
endif()
if(EIVE_ADD_ETL_LIB)
endif()
if(EIVE_ADD_JSON_LIB)
@ -328,39 +363,41 @@ add_subdirectory(${TEST_PATH})
add_subdirectory(${UNITTEST_PATH})
# This should have already been downloaded by the FSFW
# Still include it to be safe
# This should have already been downloaded by the FSFW Still include it to be
# safe
find_package(etl ${FSFW_ETL_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide etl
if(NOT etl_FOUND)
message(STATUS
message(
STATUS
"No ETL installation was found with find_package. Installing and providing "
"etl with FindPackage"
)
"etl with FindPackage")
include(FetchContent)
FetchContent_Declare(
etl
GIT_REPOSITORY https://github.com/ETLCPP/etl
GIT_TAG ${FSFW_ETL_LIB_VERSION}
)
GIT_TAG ${FSFW_ETL_LIB_VERSION})
list(APPEND FSFW_FETCH_CONTENT_TARGETS etl)
endif()
# Use same Catch2 version as framework
if (NOT(TGT_BSP MATCHES "arm/te0720-1cfa") AND NOT(TGT_BSP MATCHES "arm/q7s")
if(NOT (TGT_BSP MATCHES "arm/te0720-1cfa")
AND NOT (TGT_BSP MATCHES "arm/q7s")
AND NOT (TGT_BSP MATCHES "arm/raspberrypi"))
# Check whether the user has already installed Catch2 first
find_package(Catch2 ${FSFW_CATCH2_LIB_MAJOR_VERSION} CONFIG QUIET)
# Not installed, so use FetchContent to download and provide Catch2
if(NOT Catch2_FOUND)
message(STATUS "${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent")
message(
STATUS
"${MSG_PREFIX} Catch2 installation not found. Downloading Catch2 library with FetchContent"
)
include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG ${FSFW_CATCH2_LIB_VERSION}
)
GIT_TAG ${FSFW_CATCH2_LIB_VERSION})
list(APPEND FSFW_FETCH_CONTENT_TARGETS Catch2)
endif()
@ -375,91 +412,62 @@ if(FSFW_FETCH_CONTENT_TARGETS)
add_library(${LIB_ETL_TARGET} ALIAS etl)
endif()
if(TARGET Catch2)
# Fixes regression -preview4, to be confirmed in later releases
# Related GitHub issue: https://github.com/catchorg/Catch2/issues/2417
# Fixes regression -preview4, to be confirmed in later releases Related
# GitHub issue: https://github.com/catchorg/Catch2/issues/2417
set_target_properties(Catch2 PROPERTIES DEBUG_POSTFIX "")
set_target_properties(Catch2 PROPERTIES EXCLUDE_FROM_ALL "true")
set_target_properties(Catch2WithMain PROPERTIES EXCLUDE_FROM_ALL "true")
endif()
endif()
################################################################################
# ##############################################################################
# Post-Sources preparation
################################################################################
# ##############################################################################
# Add libraries
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_FSFW_NAME}
${LIB_LWGPS_NAME}
${LIB_OS_NAME}
)
target_link_libraries(${LIB_EIVE_MISSION}
PUBLIC ${LIB_FSFW_NAME} ${LIB_LWGPS_NAME} ${LIB_OS_NAME})
target_link_libraries(${OBSW_NAME} PRIVATE
${LIB_EIVE_MISSION}
)
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_EIVE_MISSION})
if(TGT_BSP MATCHES "arm/q7s")
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_GPS}
${LIB_ARCSEC}
)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_GPS} ${LIB_ARCSEC})
endif()
target_link_libraries(${UNITTEST_NAME} PRIVATE
Catch2
${LIB_EIVE_MISSION}
rapidcsv
)
target_link_libraries(${UNITTEST_NAME} PRIVATE Catch2 ${LIB_EIVE_MISSION}
rapidcsv)
if(TGT_BSP MATCHES "arm/egse")
target_link_libraries(${OBSW_NAME} PRIVATE
${LIB_ARCSEC}
)
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_ARCSEC})
endif()
if(ADD_CSP_LIB)
target_link_libraries(${OBSW_NAME} PRIVATE
${LIB_CSP_NAME}
)
target_link_libraries(${OBSW_NAME} PRIVATE ${LIB_CSP_NAME})
endif()
if(EIVE_ADD_ETL_LIB)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_ETL_TARGET}
)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_ETL_TARGET})
endif()
if(EIVE_ADD_JSON_LIB)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_JSON_NAME}
)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_JSON_NAME})
endif()
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC
${LIB_CXX_FS}
)
target_link_libraries(${LIB_EIVE_MISSION} PUBLIC ${LIB_CXX_FS})
# Add include paths for all sources.
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
${FSFW_CONFIG_PATH}
${CMAKE_CURRENT_BINARY_DIR}
${LIB_ARCSEC_PATH}
)
target_include_directories(
${LIB_EIVE_MISSION} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH}
${CMAKE_CURRENT_BINARY_DIR} ${LIB_ARCSEC_PATH})
if(TGT_BSP MATCHES "arm/q7s" OR TGT_BSP MATCHES "arm/egse")
target_include_directories(${LIB_EIVE_MISSION} PUBLIC
${ARCSEC_LIB_PATH}
)
target_include_directories(${LIB_EIVE_MISSION} PUBLIC ${ARCSEC_LIB_PATH})
endif()
if(CMAKE_VERBOSE)
message(STATUS "Warning flags: ${WARNING_FLAGS}")
endif()
if(CMAKE_CROSSCOMPILING)
include(HardwareOsPostConfig)
post_source_hw_os_config()
@ -484,19 +492,15 @@ endif()
install(TARGETS ${OBSW_NAME} RUNTIME DESTINATION bin)
string(CONCAT POST_BUILD_COMMENT
"Build directory: ${CMAKE_BINARY_DIR}\n"
string(CONCAT POST_BUILD_COMMENT "Build directory: ${CMAKE_BINARY_DIR}\n"
"Target OSAL: ${FSFW_OSAL}\n"
"Target Build Type: ${CMAKE_BUILD_TYPE}\n"
"${TARGET_STRING}"
)
"Target Build Type: ${CMAKE_BUILD_TYPE}\n" "${TARGET_STRING}")
add_custom_command(
TARGET ${OBSW_NAME}
POST_BUILD
COMMAND ${CMAKE_SIZE} ${OBSW_BIN_NAME}${FILE_SUFFIX}
COMMENT ${POST_BUILD_COMMENT}
)
COMMENT ${POST_BUILD_COMMENT})
include(BuildType)
set_build_type()

View File

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PUBLIC
InitMission.cpp
main.cpp
ObjectFactory.cpp
)
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
add_subdirectory(boardconfig)

View File

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE
print.c
)
target_sources(${OBSW_NAME} PRIVATE print.c)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,8 +1,4 @@
target_sources(${OBSW_NAME} PUBLIC
InitMission.cpp
main.cpp
ObjectFactory.cpp
)
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
add_subdirectory(fsfwconfig)
add_subdirectory(boardconfig)

View File

@ -1,10 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE
print.c
)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_sources(${OBSW_NAME} PRIVATE print.c)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,8 +1 @@
target_sources(${TARGET_NAME} PUBLIC
ArduinoComIF.cpp
ArduinoCookie.cpp
)
target_sources(${TARGET_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)

View File

@ -1,27 +1,15 @@
target_sources(${OBSW_NAME} PRIVATE
ipc/MissionMessageTypes.cpp
)
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# If a special translation file for object IDs exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE
objects/translateObjects.cpp
)
target_sources(${UNITTEST_NAME} PRIVATE
objects/translateObjects.cpp
)
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
endif()
# If a special translation file for events exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE
events/translateEvents.cpp
)
target_sources(${UNITTEST_NAME} PRIVATE
events/translateEvents.cpp
)
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
endif()

View File

@ -1,9 +1,5 @@
target_sources(${OBSW_NAME} PUBLIC
InitMission.cpp
main.cpp
gpioInit.cpp
ObjectFactory.cpp
)
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp gpioInit.cpp
ObjectFactory.cpp)
add_subdirectory(boardconfig)
add_subdirectory(boardtest)

View File

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PRIVATE
print.c
)
target_sources(${OBSW_NAME} PRIVATE print.c)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,6 +1 @@
target_sources(${OBSW_NAME} PRIVATE
)
target_sources(${OBSW_NAME} PRIVATE)

View File

@ -1,20 +1,13 @@
# simple mode
add_executable(${SIMPLE_OBSW_NAME} EXCLUDE_FROM_ALL)
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
target_sources(${SIMPLE_OBSW_NAME} PUBLIC
main.cpp
)
target_sources(${SIMPLE_OBSW_NAME} PUBLIC main.cpp)
# I think this is unintentional? (produces linker errors for stuff in /linux)
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC
${LIB_FSFW_NAME}
)
target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC ${LIB_FSFW_NAME})
target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE")
add_subdirectory(simple)
target_sources(${OBSW_NAME} PUBLIC
main.cpp
obsw.cpp
)
target_sources(${OBSW_NAME} PUBLIC main.cpp obsw.cpp)
add_subdirectory(boardtest)
@ -25,9 +18,7 @@ add_subdirectory(core)
if(EIVE_Q7S_EM)
add_subdirectory(em)
else()
target_sources(${OBSW_NAME} PUBLIC
fmObjectFactory.cpp
)
target_sources(${OBSW_NAME} PUBLIC fmObjectFactory.cpp)
endif()
add_subdirectory(memory)

View File

@ -1,12 +1,5 @@
target_sources(${OBSW_NAME} PRIVATE
print.c
)
target_sources(${OBSW_NAME} PRIVATE print.c)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
print.c
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE print.c)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,10 +1,5 @@
target_sources(${OBSW_NAME} PRIVATE
FileSystemTest.cpp
Q7STestTask.cpp
)
target_sources(${OBSW_NAME} PRIVATE FileSystemTest.cpp Q7STestTask.cpp)
if(EIVE_BUILD_Q7S_SIMPLE_MODE)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
FileSystemTest.cpp
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE FileSystemTest.cpp)
endif()

View File

@ -1,6 +1,2 @@
target_sources(${OBSW_NAME} PRIVATE
rwSpiCallback.cpp
gnssCallback.cpp
pcduSwitchCb.cpp
q7sGpioCallbacks.cpp
)
target_sources(${OBSW_NAME} PRIVATE rwSpiCallback.cpp gnssCallback.cpp
pcduSwitchCb.cpp q7sGpioCallbacks.cpp)

View File

@ -1,6 +1 @@
target_sources(${OBSW_NAME} PRIVATE
)
target_sources(${OBSW_NAME} PRIVATE)

View File

@ -1,9 +1,4 @@
target_sources(${OBSW_NAME} PRIVATE
CoreController.cpp
InitMission.cpp
ObjectFactory.cpp
)
target_sources(${OBSW_NAME} PRIVATE CoreController.cpp InitMission.cpp
ObjectFactory.cpp)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
InitMission.cpp
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE InitMission.cpp)

View File

@ -1,3 +1 @@
target_sources(${OBSW_NAME} PRIVATE
emObjectFactory.cpp
)
target_sources(${OBSW_NAME} PRIVATE emObjectFactory.cpp)

View File

@ -1,6 +1,2 @@
target_sources(${OBSW_NAME} PRIVATE
FileSystemHandler.cpp
SdCardManager.cpp
scratchApi.cpp
FilesystemHelper.cpp
)
target_sources(${OBSW_NAME} PRIVATE FileSystemHandler.cpp SdCardManager.cpp
scratchApi.cpp FilesystemHelper.cpp)

View File

@ -1,3 +1 @@
target_sources(${SIMPLE_OBSW_NAME} PRIVATE
simple.cpp
)
target_sources(${SIMPLE_OBSW_NAME} PRIVATE simple.cpp)

View File

@ -1,3 +1 @@
target_sources(${OBSW_NAME} PRIVATE
Xadc.cpp
)
target_sources(${OBSW_NAME} PRIVATE Xadc.cpp)

View File

@ -1,7 +1,3 @@
target_include_directories(${OBSW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_sources(${OBSW_NAME} PRIVATE
commonConfig.cpp
)
target_sources(${OBSW_NAME} PRIVATE commonConfig.cpp)

View File

@ -2,14 +2,7 @@
#define COMMON_CONFIG_CCSDSCONFIG_H_
namespace ccsds {
enum {
VC0,
VC1,
VC2,
VC3
};
enum { VC0, VC1, VC2, VC3 };
}
#endif /* COMMON_CONFIG_CCSDSCONFIG_H_ */

View File

@ -2,6 +2,7 @@
#define COMMON_CONFIG_COMMONCLASSIDS_H_
#include <fsfw/returnvalues/FwClassIds.h>
#include <cstdint>
namespace CLASS_ID {

View File

@ -1,6 +1,8 @@
#include "commonConfig.h"
#include "tmtc/apid.h"
#include "fsfw/tmtcpacket/SpacePacket.h"
const Version common::OBSW_VERSION { OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR, OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1 };
#include "fsfw/tmtcpacket/SpacePacket.h"
#include "tmtc/apid.h"
const fsfw::Version common::OBSW_VERSION{OBSW_VERSION_MAJOR, OBSW_VERSION_MINOR,
OBSW_VERSION_REVISION, OBSW_VERSION_CST_GIT_SHA1};
const uint16_t common::PUS_PACKET_ID = spacepacket::getTcSpacePacketIdFromApid(apid::EIVE_OBSW);

View File

@ -33,7 +33,7 @@ static constexpr uint8_t OBSW_VERSION_REVISION = @OBSW_VERSION_REVISION@;
// CST: Commits since tag
static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@";
extern const Version OBSW_VERSION;
extern const fsfw::Version OBSW_VERSION;
extern const uint16_t PUS_PACKET_ID;

View File

@ -125,5 +125,4 @@ enum commonObjects: uint32_t {
};
}
#endif /* COMMON_CONFIG_COMMONOBJECTS_H_ */

View File

@ -36,5 +36,4 @@ enum: uint8_t {
};
}
#endif /* COMMON_CONFIG_COMMONSUBSYSTEMIDS_H_ */

View File

@ -1,10 +1,11 @@
#ifndef COMMON_CONFIG_DEVCONF_H_
#define COMMON_CONFIG_DEVCONF_H_
#include <cstdint>
#include <fsfw_hal/linux/spi/spiDefinitions.h>
#include <fsfw_hal/linux/uart/UartCookie.h>
#include <cstdint>
/**
* SPI configuration will be contained here to let the device handlers remain independent
* of SPI specific properties.
@ -45,7 +46,7 @@ static constexpr spi::SpiModes RW_MODE = spi::SpiModes::MODE_0;
static constexpr uint32_t RTD_SPEED = 2'000'000;
static constexpr spi::SpiModes RTD_MODE = spi::SpiModes::MODE_3;
}
} // namespace spi
namespace uart {
@ -56,6 +57,6 @@ static constexpr UartBaudRate PLOC_MPSOC_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate PLOC_SUPV_BAUD = UartBaudRate::RATE_115200;
static constexpr UartBaudRate STAR_TRACKER_BAUD = UartBaudRate::RATE_921600;
}
} // namespace uart
#endif /* COMMON_CONFIG_DEVCONF_H_ */

View File

@ -19,7 +19,6 @@ static constexpr uint8_t LIVE_TM = 0;
static constexpr uint32_t MAX_PATH_SIZE = 100;
static constexpr uint32_t MAX_FILENAME_SIZE = 50;
}
} // namespace config
#endif /* COMMON_CONFIG_DEFINITIONS_H_ */

View File

@ -15,5 +15,4 @@ namespace apid {
static const uint16_t EIVE_OBSW = 0x65;
}
#endif /* FSFWCONFIG_TMTC_APID_H_ */

2
fsfw

@ -1 +1 @@
Subproject commit 4841d5d92d721383e92b521b584c7d0e62c9873d
Subproject commit e8023886f60ba3af0a63279da8dbc0d3eb0939a7

View File

@ -6,6 +6,4 @@ add_subdirectory(devices)
add_subdirectory(fsfwconfig)
add_subdirectory(obc)
target_sources(${OBSW_NAME} PUBLIC
ObjectFactory.cpp
)
target_sources(${OBSW_NAME} PUBLIC ObjectFactory.cpp)

View File

@ -1,10 +1,2 @@
target_sources(${OBSW_NAME} PRIVATE
LibgpiodTest.cpp
I2cTestClass.cpp
SpiTestClass.cpp
UartTestClass.cpp
)
target_sources(${OBSW_NAME} PRIVATE LibgpiodTest.cpp I2cTestClass.cpp
SpiTestClass.cpp UartTestClass.cpp)

View File

@ -1,3 +1 @@
target_sources(${OBSW_NAME} PRIVATE
gpioCallbacks.cpp
)
target_sources(${OBSW_NAME} PRIVATE gpioCallbacks.cpp)

View File

@ -1,8 +1 @@
target_sources(${OBSW_NAME} PUBLIC
CspComIF.cpp
CspCookie.cpp
)
target_sources(${OBSW_NAME} PUBLIC CspComIF.cpp CspCookie.cpp)

View File

@ -1,7 +1,5 @@
if(EIVE_BUILD_GPSD_GPS_HANDLER)
target_sources(${OBSW_NAME} PRIVATE
GPSHyperionLinuxController.cpp
)
target_sources(${OBSW_NAME} PRIVATE GPSHyperionLinuxController.cpp)
endif()
add_subdirectory(ploc)

View File

@ -309,7 +309,6 @@ class ApidOnlyPacket : public SpacePacket {
*/
class MPSoCBootSelect : public SpacePacket {
public:
static const uint8_t NVM0 = 0;
static const uint8_t NVM1 = 1;

View File

@ -1,7 +1,4 @@
target_sources(${OBSW_NAME} PRIVATE
PlocSupervisorHandler.cpp
PlocMemoryDumper.cpp
PlocMPSoCHandler.cpp
PlocMPSoCHelper.cpp
PlocSupvHelper.cpp
)
target_sources(
${OBSW_NAME}
PRIVATE PlocSupervisorHandler.cpp PlocMemoryDumper.cpp PlocMPSoCHandler.cpp
PlocMPSoCHelper.cpp PlocSupvHelper.cpp)

View File

@ -1062,7 +1062,8 @@ ReturnValue_t PlocSupervisorHandler::handleBootStatusReport(const uint8_t* data)
nextReplyId = supv::EXE_REPORT;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_PLOC_SUPERVISOR == 1
sif::info << "PlocSupervisorHandler::handleBootStatusReport: SoC State (0 - off, 1 - booting, 2 - Update, 3 "
sif::info << "PlocSupervisorHandler::handleBootStatusReport: SoC State (0 - off, 1 - booting, 2 "
"- Update, 3 "
"- operating, 4 - Shutdown, 5 - Reset): "
<< static_cast<unsigned int>(bootStatusReport.socState.value) << std::endl;
sif::info << "PlocSupervisorHandler::handleBootStatusReport: Power Cycles: "

View File

@ -1,7 +1,4 @@
target_sources(${OBSW_NAME} PRIVATE
StarTrackerHandler.cpp
StarTrackerJsonCommands.cpp
ArcsecDatalinkLayer.cpp
ArcsecJsonParamBase.cpp
StrHelper.cpp
)
target_sources(
${OBSW_NAME}
PRIVATE StarTrackerHandler.cpp StarTrackerJsonCommands.cpp
ArcsecDatalinkLayer.cpp ArcsecJsonParamBase.cpp StrHelper.cpp)

View File

@ -1,28 +1,16 @@
target_sources(${OBSW_NAME} PRIVATE
ipc/MissionMessageTypes.cpp
pollingsequence/pollingSequenceFactory.cpp
)
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp
pollingsequence/pollingSequenceFactory.cpp)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
# If a special translation file for object IDs exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE
objects/translateObjects.cpp
)
target_sources(${UNITTEST_NAME} PRIVATE
objects/translateObjects.cpp
)
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
endif()
# If a special translation file for events exists, compile it.
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
target_sources(${OBSW_NAME} PRIVATE
events/translateEvents.cpp
)
target_sources(${UNITTEST_NAME} PRIVATE
events/translateEvents.cpp
)
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
endif()

View File

@ -1,10 +1,3 @@
target_sources(${OBSW_NAME} PUBLIC
PapbVcInterface.cpp
Ptme.cpp
PdecHandler.cpp
PdecConfig.cpp
PtmeConfig.cpp
AxiPtmeConfig.cpp
)
target_sources(
${OBSW_NAME} PUBLIC PapbVcInterface.cpp Ptme.cpp PdecHandler.cpp
PdecConfig.cpp PtmeConfig.cpp AxiPtmeConfig.cpp)

View File

@ -1,7 +1 @@
target_sources(${OBSW_NAME} PUBLIC
utility.cpp
)
target_sources(${OBSW_NAME} PUBLIC utility.cpp)

View File

@ -1,3 +1 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
ThermalController.cpp
)
target_sources(${LIB_EIVE_MISSION} PRIVATE ThermalController.cpp)

View File

@ -1,5 +1 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
GenericFactory.cpp
)
target_sources(${LIB_EIVE_MISSION} PRIVATE GenericFactory.cpp)

View File

@ -1,5 +1,6 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
GomspaceDeviceHandler.cpp
target_sources(
${LIB_EIVE_MISSION}
PRIVATE GomspaceDeviceHandler.cpp
BpxBatteryHandler.cpp
Tmp1075Handler.cpp
PCDUHandler.cpp
@ -17,5 +18,4 @@ target_sources(${LIB_EIVE_MISSION} PRIVATE
max1227.cpp
SusHandler.cpp
PayloadPcduHandler.cpp
SolarArrayDeploymentHandler.cpp
)
SolarArrayDeploymentHandler.cpp)

View File

@ -1,5 +1 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
NVMParameterBase.cpp
)
target_sources(${LIB_EIVE_MISSION} PRIVATE NVMParameterBase.cpp)

View File

@ -1,16 +1,15 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
EiveSystem.cpp
target_sources(
${LIB_EIVE_MISSION}
PRIVATE EiveSystem.cpp
AcsSubsystem.cpp
ComSubsystem.cpp
PayloadSubsystem.cpp
AcsBoardAssembly.cpp
RwAssembly.cpp
SusAssembly.cpp
DualLanePowerStateMachine.cpp
PowerStateMachineBase.cpp
DualLaneAssemblyBase.cpp
TcsBoardAssembly.cpp
)
TcsBoardAssembly.cpp)
add_subdirectory(fdir)

View File

@ -1,7 +1,3 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
AcsBoardFdir.cpp
RtdFdir.cpp
SusFdir.cpp
SyrlinksFdir.cpp
GomspacePowerFdir.cpp
)
target_sources(
${LIB_EIVE_MISSION} PRIVATE AcsBoardFdir.cpp RtdFdir.cpp SusFdir.cpp
SyrlinksFdir.cpp GomspacePowerFdir.cpp)

View File

@ -1,6 +1 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
CCSDSHandler.cpp
VirtualChannel.cpp
)
target_sources(${LIB_EIVE_MISSION} PRIVATE CCSDSHandler.cpp VirtualChannel.cpp)

View File

@ -1,8 +1,2 @@
target_sources(${LIB_EIVE_MISSION} PRIVATE
TmFunnel.cpp
Timestamp.cpp
ProgressPrinter.cpp
Filenaming.cpp
)
target_sources(${LIB_EIVE_MISSION} PRIVATE TmFunnel.cpp Timestamp.cpp
ProgressPrinter.cpp Filenaming.cpp)

View File

@ -1,14 +0,0 @@
#!/bin/bash
if [[ ! -f README.md ]]; then
cd ..
fi
find ./mission -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./linux -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./bsp_q7s -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./bsp_linux_board -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./bsp_hosted -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./bsp_egse -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./test -iname *.h -o -iname *.cpp -o -iname *.c | xargs clang-format --style=file -i
find ./unittest -iname *.h -o -iname *.cpp -o -iname *.c -o -type d -name build -prune | \
xargs clang-format --style=file -i

40
scripts/auto-formatter.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
if [[ ! -f README.md ]]; then
cd ..
fi
folder_list=(
"./mission"
"./linux"
"./bsp_q7s"
"./bsp_linux_board"
"./bsp_hosted"
"./bsp_egse"
"./test"
"./common"
)
cmake_fmt="cmake-format"
file_selectors="-iname CMakeLists.txt"
if command -v ${cmake_fmt} &> /dev/null; then
echo "Auto-formatting all CMakeLists.txt files"
${cmake_fmt} -i CMakeLists.txt
for dir in ${folder_list[@]}; do
find ${dir} ${file_selectors} | xargs ${cmake_fmt} -i
done
else
echo "No ${cmake_fmt} tool found, not formatting CMake files"
fi
cpp_format="clang-format"
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
if command -v ${cpp_format} &> /dev/null; then
for dir in ${folder_list[@]}; do
echo "Auto-formatting C/C++ files in ${dir} recursively"
find ${dir} ${file_selectors} | xargs ${cpp_format} --style=file -i
done
find ./unittest ${file_selectors} -o -type d -name build -prune | \
xargs clang-format --style=file -i
else
echo "No ${cpp_format} tool found, not formatting C++/C files"
fi

View File

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PUBLIC
DummyGpioIF.cpp
)
target_sources(${OBSW_NAME} PUBLIC DummyGpioIF.cpp)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

View File

@ -1,7 +1,3 @@
target_sources(${OBSW_NAME} PUBLIC
TestTask.cpp
)
target_sources(${OBSW_NAME} PUBLIC TestTask.cpp)
target_include_directories(${OBSW_NAME} PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

2
tmtc

@ -1 +1 @@
Subproject commit b81f756e4b70e55a443cba50bab0a519a0dc3591
Subproject commit 0ebf04449668909a8f570891d27e89b93f0105c3