diff --git a/CMakeLists.txt b/CMakeLists.txt index 03d51ac2..b959b5a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,8 +37,12 @@ endif() include(${CMAKE_SCRIPT_PATH}/PreProjectConfig.cmake) pre_project_config() +# Check whether the user has already installed Catch2 first. This has to come before +# the project call. We could also exlcude doing this when the Q7S primary OBSW is built.. +find_package(Catch2 3 CONFIG QUIET) + # Project Name -project(eive-obsw ASM C CXX) +project(eive-obsw) ################################################################################ # Pre-Sources preparation @@ -150,9 +154,6 @@ set(FSFW_ADDITIONAL_INC_PATHS ${CMAKE_CURRENT_BINARY_DIR} ) -# Check whether the user has already installed Catch2 first -find_package(Catch2 3) - ################################################################################ # Executable and Sources ################################################################################ @@ -199,8 +200,10 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") set(COMPILER_FLAGS "/permissive-") endif() + # Not installed, so use FetchContent to download and provide Catch2 if(NOT Catch2_FOUND) + message(STATUS "Did not find a valid Catch2 installation. Using FetchContent to install it") include(FetchContent) FetchContent_Declare( diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp index 587d22f0..7204db14 100644 --- a/bsp_q7s/core/CoreController.cpp +++ b/bsp_q7s/core/CoreController.cpp @@ -625,9 +625,9 @@ ReturnValue_t CoreController::initVersionFile() { std::string fullObswVersionString = "OBSW: v" + std::to_string(SW_VERSION) + "." + std::to_string(SW_SUBVERSION) + "." + std::to_string(SW_REVISION); - std::string fullFsfwVersionString = "FSFW: v" + std::to_string(FSFW_VERSION.major) + "." + - std::to_string(FSFW_VERSION.minor) + "." + - std::to_string(FSFW_VERSION.revision); + char versionString[16] = {}; + fsfw::FSFW_VERSION.getVersion(versionString, sizeof(versionString)); + std::string fullFsfwVersionString = "FSFW: v" + std::string(versionString); std::string systemString = "System: " + unameLine; std::string mountPrefix = SdCardManager::instance()->getCurrentMountPrefix(); std::string versionFilePath = mountPrefix + VERSION_FILE; diff --git a/bsp_q7s/core/obsw.cpp b/bsp_q7s/core/obsw.cpp index ca7271ce..197ca66b 100644 --- a/bsp_q7s/core/obsw.cpp +++ b/bsp_q7s/core/obsw.cpp @@ -14,7 +14,6 @@ static int OBSW_ALREADY_RUNNING = -2; int obsw::obsw() { using namespace fsfw; - fsfw::getVersion(version); std::cout << "-- EIVE OBSW --" << std::endl; #if BOARD_TE0720 == 0 std::cout << "-- Compiled for Linux (Xiphos Q7S) --" << std::endl; @@ -22,8 +21,7 @@ int obsw::obsw() { std::cout << "-- Compiled for Linux (TE0720) --" << std::endl; #endif std::cout << "-- OBSW v" << SW_VERSION << "." << SW_SUBVERSION << "." << SW_REVISION << ", FSFW v" - << FSFW_VERSION.major << "." << FSFW_VERSION.minor << "." << FSFW_VERSION.revision - << "--" << std::endl; + << FSFW_VERSION << "--" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; #if Q7S_CHECK_FOR_ALREADY_RUNNING_IMG == 1 diff --git a/bsp_q7s/memory/SdCardManager.cpp b/bsp_q7s/memory/SdCardManager.cpp index b336b84c..4ca11787 100644 --- a/bsp_q7s/memory/SdCardManager.cpp +++ b/bsp_q7s/memory/SdCardManager.cpp @@ -406,7 +406,7 @@ SdCardManager::OpStatus SdCardManager::checkCurrentOp(Operations& currentOp) { bool bytesRead = false; #if OBSW_ENABLE_TIMERS == 1 - Countdown timer(100); + Countdown timer(1000); #endif while (true) { ReturnValue_t result = cmdExecutor.check(bytesRead); diff --git a/bsp_q7s/memory/scratchApi.h b/bsp_q7s/memory/scratchApi.h index babd26dc..96264995 100644 --- a/bsp_q7s/memory/scratchApi.h +++ b/bsp_q7s/memory/scratchApi.h @@ -75,7 +75,7 @@ ReturnValue_t readToFile(std::string name, std::ifstream& file, std::string& fil int result = std::system(oss.str().c_str()); if (result != 0) { - if (result == 256) { + if (WEXITSTATUS(result) == 1) { sif::warning << "scratch::readNumber: Key " << name << " does not exist" << std::endl; // Could not find value std::remove(filename.c_str()); diff --git a/common/config/OBSWVersion.h b/common/config/OBSWVersion.h index f719a274..71fd3355 100644 --- a/common/config/OBSWVersion.h +++ b/common/config/OBSWVersion.h @@ -5,6 +5,6 @@ const char* const SW_NAME = "eive"; #define SW_VERSION 1 #define SW_SUBVERSION 9 -#define SW_REVISION 0 +#define SW_REVISION 1 #endif /* COMMON_CONFIG_OBSWVERSION_H_ */ diff --git a/fsfw b/fsfw index 9509847b..17262a1d 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 9509847b849c18374a5df809c2fb83dd98d66dc3 +Subproject commit 17262a1da91a92c3b5995ccfbd67d439d01bb456 diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index 53c84564..5bcf3bc2 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -1,14 +1,7 @@ -#! /usr/bin/python3 +#! /usr/bin/env python3 # -*- coding: utf-8 -*- -""" -:file: returnvalues_parser.py -:brief: Part of the MOD export tools for the SOURCE project by KSat. -TODO: Integrate into Parser Structure instead of calling this file (no cpp file generated yet) -:details: -Return Value exporter. -To use MySQLdb, run pip install mysqlclient or install in IDE. On Windows, Build Tools -installation might be necessary. -:data: 21.11.2019 +"""Part of the MIB export tools for the EIVE project by. +Returnvalue exporter. """ from fsfwgen.core import get_console_logger from fsfwgen.utility.file_management import copy_file diff --git a/tmtc b/tmtc index de68ad93..eedb45e4 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit de68ad9341fbe5570b84305f33562702e3486364 +Subproject commit eedb45e4f34bd77d328745808e9acfe4668a1e35