Merge remote-tracking branch 'upstream/development' into mueller/timeman-update
This commit is contained in:
commit
1ad94bae7d
@ -3,14 +3,23 @@ cmake_minimum_required(VERSION 3.13)
|
|||||||
set(LIB_FSFW_NAME fsfw)
|
set(LIB_FSFW_NAME fsfw)
|
||||||
add_library(${LIB_FSFW_NAME})
|
add_library(${LIB_FSFW_NAME})
|
||||||
|
|
||||||
# Set options for FSFW OSAL selection.
|
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos)
|
||||||
|
|
||||||
|
if(NOT OS_FSFW)
|
||||||
|
message(STATUS "No OS for FSFW via OS_FSFW set. Assuming host OS")
|
||||||
|
# Assume host OS and autodetermine from OS_FSFW
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
set(OS_FSFW "linux" CACHE STRING "OS abstraction layer used in the FSFW")
|
set(OS_FSFW "linux"
|
||||||
|
CACHE STRING
|
||||||
|
"OS abstraction layer used in the FSFW"
|
||||||
|
)
|
||||||
elseif(WIN32)
|
elseif(WIN32)
|
||||||
set(OS_FSFW "host" CACHE STRING "OS abstraction layer used in the FSFW")
|
set(OS_FSFW "host"
|
||||||
|
CACHE STRING "OS abstraction layer used in the FSFW"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set_property(CACHE OS_FSFW PROPERTY STRINGS host linux rtems freertos)
|
endif()
|
||||||
|
|
||||||
if(${OS_FSFW} STREQUAL host)
|
if(${OS_FSFW} STREQUAL host)
|
||||||
set(OS_FSFW_NAME "Host")
|
set(OS_FSFW_NAME "Host")
|
||||||
@ -18,15 +27,18 @@ elseif(${OS_FSFW} STREQUAL linux)
|
|||||||
set(OS_FSFW_NAME "Linux")
|
set(OS_FSFW_NAME "Linux")
|
||||||
elseif(${OS_FSFW} STREQUAL freertos)
|
elseif(${OS_FSFW} STREQUAL freertos)
|
||||||
set(OS_FSFW_NAME "FreeRTOS")
|
set(OS_FSFW_NAME "FreeRTOS")
|
||||||
|
target_link_libraries(${LIB_FSFW_NAME} ${LIB_OS_NAME})
|
||||||
elseif(${OS_FSFW} STREQUAL rtems)
|
elseif(${OS_FSFW} STREQUAL rtems)
|
||||||
set(OS_FSFW_NAME "RTEMS")
|
set(OS_FSFW_NAME "RTEMS")
|
||||||
else()
|
else()
|
||||||
message(WARNING "Invalid operating system for FSFW specified! Setting to host..")
|
message(WARNING
|
||||||
|
"Invalid operating system for FSFW specified! Setting to host.."
|
||||||
|
)
|
||||||
set(OS_FSFW_NAME "Host")
|
set(OS_FSFW_NAME "Host")
|
||||||
set(OS_FSFW "host")
|
set(OS_FSFW "host")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system")
|
message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.")
|
||||||
|
|
||||||
# Options to exclude parts of the FSFW from compilation.
|
# Options to exclude parts of the FSFW from compilation.
|
||||||
option(FSFW_USE_RMAP "Compile with RMAP" ON)
|
option(FSFW_USE_RMAP "Compile with RMAP" ON)
|
||||||
@ -36,8 +48,14 @@ add_subdirectory(action)
|
|||||||
add_subdirectory(container)
|
add_subdirectory(container)
|
||||||
add_subdirectory(controller)
|
add_subdirectory(controller)
|
||||||
add_subdirectory(coordinates)
|
add_subdirectory(coordinates)
|
||||||
|
|
||||||
|
if(FSFW_USE_DATALINKLAYER)
|
||||||
add_subdirectory(datalinklayer)
|
add_subdirectory(datalinklayer)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_subdirectory(datapool)
|
add_subdirectory(datapool)
|
||||||
|
add_subdirectory(datapoollocal)
|
||||||
|
add_subdirectory(housekeeping)
|
||||||
add_subdirectory(devicehandlers)
|
add_subdirectory(devicehandlers)
|
||||||
add_subdirectory(events)
|
add_subdirectory(events)
|
||||||
add_subdirectory(fdir)
|
add_subdirectory(fdir)
|
||||||
@ -78,8 +96,48 @@ message(WARNING "Setting default configuration!")
|
|||||||
add_subdirectory(defaultcfg/fsfwconfig)
|
add_subdirectory(defaultcfg/fsfwconfig)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Required include paths to compile the FSFW
|
# FSFW might be part of a possibly complicated folder structure, so we
|
||||||
target_include_directories(${LIB_FSFW_NAME}
|
# extract the absolute path of the fsfwconfig folder.
|
||||||
INTERFACE
|
if(IS_ABSOLUTE ${FSFW_CONFIG_PATH})
|
||||||
${FSFW_CONFIG_PATH}
|
set(FSFW_CONFIG_PATH_ABSOLUTE ${FSFW_CONFIG_PATH})
|
||||||
|
else()
|
||||||
|
get_filename_component(FSFW_CONFIG_PATH_ABSOLUTE
|
||||||
|
${FSFW_CONFIG_PATH} REALPATH BASE_DIR ${CMAKE_SOURCE_DIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
set(WARNING_FLAGS
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Wshadow=local
|
||||||
|
-Wimplicit-fallthrough=1
|
||||||
|
-Wno-unused-parameter
|
||||||
|
-Wno-psabi
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
set(COMPILER_FLAGS "/permissive-")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Required include paths to compile the FSFW
|
||||||
|
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||||
|
${CMAKE_SOURCE_DIR}
|
||||||
|
${FSFW_CONFIG_PATH_ABSOLUTE}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Includes path required to compile FSFW itself as well
|
||||||
|
# We assume that the fsfwconfig folder uses include relative to the project
|
||||||
|
# root here!
|
||||||
|
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
||||||
|
${CMAKE_SOURCE_DIR}
|
||||||
|
${FSFW_CONFIG_PATH_ABSOLUTE}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Machine specific options can be set with the ABI_FLAGS variable.
|
||||||
|
target_compile_options(${LIB_FSFW_NAME} PRIVATE
|
||||||
|
${WARNING_FLAGS}
|
||||||
|
${COMPILER_FLAGS}
|
||||||
|
${ABI_FLAGS}
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
#ifndef SGP4PROPAGATOR_H_
|
#ifndef SGP4PROPAGATOR_H_
|
||||||
#define SGP4PROPAGATOR_H_
|
#define SGP4PROPAGATOR_H_
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
#include "../contrib/sgp4/sgp4unit.h"
|
#include "../contrib/sgp4/sgp4unit.h"
|
||||||
#include "../returnvalues/HasReturnvaluesIF.h"
|
#include "../returnvalues/HasReturnvaluesIF.h"
|
||||||
|
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
target_sources(${LIB_FSFW_NAME}
|
target_sources(${LIB_FSFW_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
ControllerSet.cpp
|
|
||||||
DataPool.cpp
|
|
||||||
DataPoolAdmin.cpp
|
|
||||||
DataPoolParameterWrapper.cpp
|
|
||||||
DataSet.cpp
|
|
||||||
HkSwitchHelper.cpp
|
HkSwitchHelper.cpp
|
||||||
|
PoolDataSetBase.cpp
|
||||||
PoolEntry.cpp
|
PoolEntry.cpp
|
||||||
PoolRawAccess.cpp
|
|
||||||
)
|
)
|
8
datapoollocal/CMakeLists.txt
Normal file
8
datapoollocal/CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
target_sources(${LIB_FSFW_NAME}
|
||||||
|
PRIVATE
|
||||||
|
LocalDataPoolManager.cpp
|
||||||
|
LocalDataSet.cpp
|
||||||
|
LocalPoolDataSetBase.cpp
|
||||||
|
LocalPoolObjectBase.cpp
|
||||||
|
SharedLocalDataSet.cpp
|
||||||
|
)
|
@ -1,6 +1,5 @@
|
|||||||
target_sources(${LIB_FSFW_NAME}
|
target_sources(${LIB_FSFW_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
Event.cpp
|
|
||||||
EventManager.cpp
|
EventManager.cpp
|
||||||
EventMessage.cpp
|
EventMessage.cpp
|
||||||
)
|
)
|
||||||
|
@ -2,7 +2,12 @@
|
|||||||
#define TIMEVALOPERATIONS_H_
|
#define TIMEVALOPERATIONS_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
timeval& operator+=(timeval& lhs, const timeval& rhs);
|
timeval& operator+=(timeval& lhs, const timeval& rhs);
|
||||||
|
|
||||||
|
5
housekeeping/CMakeLists.txt
Normal file
5
housekeeping/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
target_sources(${LIB_FSFW_NAME}
|
||||||
|
PRIVATE
|
||||||
|
HousekeepingMessage.cpp
|
||||||
|
PeriodicHousekeepingHelper.cpp
|
||||||
|
)
|
@ -22,9 +22,23 @@
|
|||||||
#else
|
#else
|
||||||
#error "Can't decide which end is which!"
|
#error "Can't decide which end is which!"
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <Windows.h>
|
||||||
|
#if REG_DWORD == REG_DWORD_LITTLE_ENDIAN
|
||||||
|
#define BYTE_ORDER_SYSTEM LITTLE_ENDIAN
|
||||||
|
#else
|
||||||
|
#define BYTE_ORDER_SYSTEM BIG_ENDIAN
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error __BYTE_ORDER__ not defined
|
#error __BYTE_ORDER__ not defined
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
30
osal/FreeRTOS/CMakeLists.txt
Normal file
30
osal/FreeRTOS/CMakeLists.txt
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
target_sources(${LIB_FSFW_NAME}
|
||||||
|
PRIVATE
|
||||||
|
Clock.cpp
|
||||||
|
FixedTimeslotTask.cpp
|
||||||
|
BinarySemaphore.cpp
|
||||||
|
BinSemaphUsingTask.cpp
|
||||||
|
CountingSemaphore.cpp
|
||||||
|
CountingSemaphUsingTask.cpp
|
||||||
|
MessageQueue.cpp
|
||||||
|
Mutex.cpp
|
||||||
|
MutexFactory.cpp
|
||||||
|
PeriodicTask.cpp
|
||||||
|
QueueFactory.cpp
|
||||||
|
SemaphoreFactory.cpp
|
||||||
|
TaskFactory.cpp
|
||||||
|
Timekeeper.cpp
|
||||||
|
TaskManagement.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
# FreeRTOS is required to link the FSFW now. It is recommended to compile
|
||||||
|
# FreeRTOS as a static library and set LIB_OS_NAME to the target name of the
|
||||||
|
# library.
|
||||||
|
if(NOT LIB_OS_NAME)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"FreeRTOS needs to be linked as a target and "
|
||||||
|
"LIB_OS_NAME needs to be set to the target"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_link_libraries(${LIB_FSWFW_NAME} ${LIB_OS_NAME})
|
@ -13,9 +13,9 @@ target_sources(${LIB_FSFW_NAME}
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
add_definitions(-pthread)
|
|
||||||
target_link_libraries(${LIB_FSFW_NAME}
|
target_link_libraries(${LIB_FSFW_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
rt
|
rt
|
||||||
|
pthread
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
@ -119,7 +119,7 @@ void TcWinUdpPollingTask::setTimeout(double timeoutSeconds) {
|
|||||||
int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO,
|
int result = setsockopt(serverUdpSocket, SOL_SOCKET, SO_RCVTIMEO,
|
||||||
reinterpret_cast<const char*>(&timeoutMs), sizeof(DWORD));
|
reinterpret_cast<const char*>(&timeoutMs), sizeof(DWORD));
|
||||||
if(result == -1) {
|
if(result == -1) {
|
||||||
sif::error << "TcSocketPollingTask::TcSocketPollingTask: Setting "
|
sif::error << "TcWinUdpPollingTask::TcSocketPollingTask: Setting "
|
||||||
"receive timeout failed with " << strerror(errno) << std::endl;
|
"receive timeout failed with " << strerror(errno) << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -128,17 +128,22 @@ void TcWinUdpPollingTask::handleReadError() {
|
|||||||
int error = WSAGetLastError();
|
int error = WSAGetLastError();
|
||||||
switch(error) {
|
switch(error) {
|
||||||
case(WSANOTINITIALISED): {
|
case(WSANOTINITIALISED): {
|
||||||
sif::info << "TmTcWinUdpBridge::handleReadError: WSANOTINITIALISED: "
|
sif::info << "TcWinUdpPollingTask::handleReadError: WSANOTINITIALISED: "
|
||||||
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
<< "WSAStartup(...) call " << "necessary" << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case(WSAEFAULT): {
|
case(WSAEFAULT): {
|
||||||
sif::info << "TmTcWinUdpBridge::handleReadError: WSADEFAULT: "
|
sif::info << "TcWinUdpPollingTask::handleReadError: WSADEFAULT: "
|
||||||
<< "Bad address " << std::endl;
|
<< "Bad address " << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case(WSAEINVAL): {
|
||||||
|
sif::info << "TcWinUdpPollingTask::handleReadError: WSAEINVAL: "
|
||||||
|
<< "Invalid input parameters. " << std::endl;
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
sif::info << "TmTcWinUdpBridge::handleReadError: Error code: "
|
sif::info << "TcWinUdpPollingTask::handleReadError: Error code: "
|
||||||
<< error << std::endl;
|
<< error << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2,4 +2,6 @@ target_sources(${LIB_FSFW_NAME}
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
ConstStorageAccessor.cpp
|
ConstStorageAccessor.cpp
|
||||||
StorageAccessor.cpp
|
StorageAccessor.cpp
|
||||||
|
LocalPool.cpp
|
||||||
|
PoolManager.cpp
|
||||||
)
|
)
|
@ -1,10 +1,10 @@
|
|||||||
target_sources(${LIB_FSFW_NAME}
|
target_sources(${LIB_FSFW_NAME}
|
||||||
PRIVATE
|
PRIVATE
|
||||||
AbstractTemperatureSensor.cpp
|
AbstractTemperatureSensor.cpp
|
||||||
CoreComponent.cpp
|
|
||||||
Heater.cpp
|
Heater.cpp
|
||||||
RedundantHeater.cpp
|
RedundantHeater.cpp
|
||||||
|
ThermalComponentCore.cpp
|
||||||
ThermalComponent.cpp
|
ThermalComponent.cpp
|
||||||
ThermalModule.cpp
|
ThermalModule.cpp
|
||||||
ThermalMonitor.cpp
|
ThermalMonitorReporter.cpp
|
||||||
)
|
)
|
||||||
|
@ -7,7 +7,12 @@
|
|||||||
#include "../globalfunctions/timevalOperations.h"
|
#include "../globalfunctions/timevalOperations.h"
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
class Clock {
|
class Clock {
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user