simple mode implemented
This commit is contained in:
parent
4c879fc768
commit
4f2b422711
@ -15,6 +15,10 @@ cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||
|
||||
if(TGT_BSP MATCHES "arm/q7s")
|
||||
option(Q7S_SIMPLE_MODE OFF "Simple mode with a minimal main function")
|
||||
endif()
|
||||
|
||||
option(ADD_ETL_LIB "Add ETL library" ON)
|
||||
if(NOT OS_FSFW)
|
||||
set(OS_FSFW host CACHE STRING "OS for the FSFW.")
|
||||
|
@ -1,7 +1,5 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_
|
||||
#define BSP_Q7S_BOARDCONFIG_Q7S_CONFIG_H_
|
||||
|
||||
#cmakedefine01 Q7S_SIMPLE_MODE
|
||||
#define Q7S_ADD_RTD_DEVICES 0
|
||||
|
||||
/* Only one of those 2 should be enabled! */
|
||||
|
@ -1,3 +1,6 @@
|
||||
target_sources(${TARGET_NAME} PRIVATE
|
||||
CoreController.cpp
|
||||
obsw.cpp
|
||||
InitMission.cpp
|
||||
ObjectFactory.cpp
|
||||
)
|
||||
|
25
bsp_q7s/core/obsw.cpp
Normal file
25
bsp_q7s/core/obsw.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
#include "obsw.h"
|
||||
#include "OBSWVersion.h"
|
||||
#include "InitMission.h"
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include <iostream>
|
||||
|
||||
int obsw::obsw() {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
#if TE0720 == 0
|
||||
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
|
||||
#else
|
||||
std::cout << "-- Compiled for Linux (TE0720) --" << std::endl;
|
||||
#endif
|
||||
std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "."
|
||||
<< SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
initmission::initMission();
|
||||
|
||||
for(;;) {
|
||||
/* Suspend main thread by sleeping it. */
|
||||
TaskFactory::delayTask(5000);
|
||||
}
|
||||
return 0;
|
||||
}
|
10
bsp_q7s/core/obsw.h
Normal file
10
bsp_q7s/core/obsw.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef BSP_Q7S_CORE_OBSW_H_
|
||||
#define BSP_Q7S_CORE_OBSW_H_
|
||||
|
||||
namespace obsw {
|
||||
|
||||
int obsw();
|
||||
|
||||
};
|
||||
|
||||
#endif /* BSP_Q7S_CORE_OBSW_H_ */
|
@ -1,11 +1,10 @@
|
||||
#include "InitMission.h"
|
||||
#include <OBSWVersion.h>
|
||||
#include <fsfw/tasks/TaskFactory.h>
|
||||
#include "OBSWConfig.h"
|
||||
#include "q7sConfig.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <unistd.h>
|
||||
#if Q7S_SIMPLE_MODE == 0
|
||||
#include "core/obsw.h"
|
||||
#else
|
||||
#include "simple/simple.h"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief This is the main program for the target hardware.
|
||||
@ -13,22 +12,9 @@
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
#if TE0720 == 0
|
||||
std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl;
|
||||
#if Q7S_SIMPLE_MODE == 0
|
||||
return obsw::obsw();
|
||||
#else
|
||||
std::cout << "-- Compiled for Linux (TE0720) --" << std::endl;
|
||||
return simple::simple();
|
||||
#endif
|
||||
std::cout << "-- Software version " << SW_NAME << " v" << SW_VERSION << "."
|
||||
<< SW_SUBVERSION << "." << SW_SUBSUBVERSION << " -- " << std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
|
||||
initmission::initMission();
|
||||
|
||||
for(;;) {
|
||||
/* Suspend main thread by sleeping it. */
|
||||
TaskFactory::delayTask(5000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
5
bsp_q7s/simple/simple.cpp
Normal file
5
bsp_q7s/simple/simple.cpp
Normal file
@ -0,0 +1,5 @@
|
||||
#include "simple.h"
|
||||
|
||||
int simple::simple() {
|
||||
return 0;
|
||||
}
|
10
bsp_q7s/simple/simple.h
Normal file
10
bsp_q7s/simple/simple.h
Normal file
@ -0,0 +1,10 @@
|
||||
#ifndef BSP_Q7S_SIMPLE_SIMPLE_H_
|
||||
#define BSP_Q7S_SIMPLE_SIMPLE_H_
|
||||
|
||||
namespace simple {
|
||||
|
||||
int simple();
|
||||
|
||||
}
|
||||
|
||||
#endif /* BSP_Q7S_SIMPLE_SIMPLE_H_ */
|
@ -20,10 +20,16 @@ build_dir="build-Debug-Q7S"
|
||||
build_generator=""
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
|
||||
|
@ -16,14 +16,19 @@ fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="build-Release-Q7S"
|
||||
build_dir="build-Debug-Q7S"
|
||||
build_generator=""
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "release" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
# set +x
|
||||
|
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f "cmake_build_config.py" ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "cmake_build_config.py not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="build-Debug-Q7S"
|
||||
build_generator="Ninja"
|
||||
|
||||
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
@ -16,14 +16,20 @@ fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="build-Release-Q7S"
|
||||
build_dir="build-Debug-Q7S"
|
||||
build_generator=""
|
||||
definitions="Q7S_SIMPLE_MODE=On"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
build_generator="MinGW Makefiles"
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
build_generator="Unix Makefiles"
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
python3 cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "reldeb" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}"
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}" -d "${definitions}
|
||||
# set +x
|
34
cmake/scripts/Q7S/simple_ninja_debug_cfg.sh
Executable file
34
cmake/scripts/Q7S/simple_ninja_debug_cfg.sh
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
counter=0
|
||||
while [ ${counter} -lt 5 ]
|
||||
do
|
||||
cd ..
|
||||
if [ -f "cmake_build_config.py" ];then
|
||||
break
|
||||
fi
|
||||
counter=$((counter=counter + 1))
|
||||
done
|
||||
|
||||
if [ "${counter}" -ge 5 ];then
|
||||
echo "cmake_build_config.py not found in upper directories!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
os_fsfw="linux"
|
||||
tgt_bsp="arm/q7s"
|
||||
build_dir="build-Debug-Q7S"
|
||||
build_generator="Ninja"
|
||||
definitions="Q7S_SIMPLE_MODE=On"
|
||||
if [ "${OS}" = "Windows_NT" ]; then
|
||||
python="py"
|
||||
# Could be other OS but this works for now.
|
||||
else
|
||||
python="python3"
|
||||
fi
|
||||
|
||||
echo "Running command (without the leading +):"
|
||||
set -x # Print command
|
||||
${python} cmake_build_config.py -o "${os_fsfw}" -g "${build_generator}" -b "debug" -t "${tgt_bsp}" \
|
||||
-l"${build_dir}" -d "${definitions}
|
||||
# set +x
|
||||
|
Loading…
Reference in New Issue
Block a user