diff --git a/.gitmodules b/.gitmodules index 6f538287..44a86d86 100644 --- a/.gitmodules +++ b/.gitmodules @@ -15,7 +15,7 @@ url = https://github.com/rmspacefish/lwgps.git [submodule "fsfw_hal"] path = fsfw_hal - url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw_hal.git -[submodule "generators/modgen"] - path = generators/modgen - url = https://git.ksat-stuttgart.de/source/modgen.git + url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-hal.git +[submodule "generators/fsfwgen"] + path = generators/fsfwgen + url = https://egit.irs.uni-stuttgart.de/fsfw/fsfw-generators.git diff --git a/CMakeLists.txt b/CMakeLists.txt index f0887e25..33c6edfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ set(MISSION_PATH mission) set(TEST_PATH test/testtasks) set(LINUX_PATH linux) set(COMMON_PATH common) +set(COMMON_CONFIG_PATH ${COMMON_PATH}/config) set(FSFW_HAL_LIB_PATH fsfw_hal) set(CSP_LIB_PATH ${THIRD_PARTY_FOLDER}/libcsp) @@ -95,8 +96,21 @@ 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) +configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) +if(${TGT_BSP} MATCHES "arm/q7s") + configure_file(${BSP_PATH}/boardconfig/q7sConfig.h.in q7sConfig.h) +elseif(${TGT_BSP} MATCHES "arm/raspberrypi") + configure_file(${BSP_PATH}/boardconfig/rpiConfig.h.in rpiConfig.h) +endif() + # Set common config path for FSFW -set(FSFW_ADDITIONAL_INC_PATH "${COMMON_PATH}/config") +set(FSFW_ADDITIONAL_INC_PATHS + "${COMMON_PATH}/config" + ${CMAKE_CURRENT_BINARY_DIR} +) # Set for lwgps library set(LWGPS_CONFIG_PATH "${COMMON_PATH}/config") @@ -157,6 +171,7 @@ endif() target_include_directories(${TARGET_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${FSFW_CONFIG_PATH} + ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/bsp_hosted/Dockerfile b/bsp_hosted/Dockerfile index dccf909a..c55ccc67 100644 --- a/bsp_hosted/Dockerfile +++ b/bsp_hosted/Dockerfile @@ -1,6 +1,9 @@ FROM ubuntu:latest # FROM alpine:latest +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + RUN apt-get update && apt-get install -y cmake g++ # RUN apk add cmake make g++ diff --git a/bsp_hosted/InitMission.cpp b/bsp_hosted/InitMission.cpp index 06bc5646..2743aa36 100644 --- a/bsp_hosted/InitMission.cpp +++ b/bsp_hosted/InitMission.cpp @@ -32,9 +32,9 @@ ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); diff --git a/bsp_hosted/ObjectFactory.cpp b/bsp_hosted/ObjectFactory.cpp index da07b0b5..743ee03e 100644 --- a/bsp_hosted/ObjectFactory.cpp +++ b/bsp_hosted/ObjectFactory.cpp @@ -36,7 +36,7 @@ void Factory::setStaticFrameworkObjectIds(){ TmPacketBase::timeStamperId = objects::TIME_STAMPER; } -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); diff --git a/bsp_hosted/ObjectFactory.h b/bsp_hosted/ObjectFactory.h index f7fa81ac..feaba70e 100644 --- a/bsp_hosted/ObjectFactory.h +++ b/bsp_hosted/ObjectFactory.h @@ -1,17 +1,10 @@ -/* - * ObjectFactory.h - * - * Created on: Sep 22, 2020 - * Author: steffen - */ - #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_hosted/fsfwconfig/FSFWConfig.h b/bsp_hosted/fsfwconfig/FSFWConfig.h.in similarity index 100% rename from bsp_hosted/fsfwconfig/FSFWConfig.h rename to bsp_hosted/fsfwconfig/FSFWConfig.h.in diff --git a/bsp_hosted/fsfwconfig/OBSWConfig.h b/bsp_hosted/fsfwconfig/OBSWConfig.h.in similarity index 100% rename from bsp_hosted/fsfwconfig/OBSWConfig.h rename to bsp_hosted/fsfwconfig/OBSWConfig.h.in diff --git a/bsp_linux_board/InitMission.cpp b/bsp_linux_board/InitMission.cpp index 154797dc..a94c2e7d 100644 --- a/bsp_linux_board/InitMission.cpp +++ b/bsp_linux_board/InitMission.cpp @@ -26,9 +26,9 @@ ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); @@ -117,6 +117,10 @@ void initmission::initTasks() { if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS20", objects::PUS_SERVICE_20_PARAMETERS); } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS3", objects::PUS_SERVICE_3_HOUSEKEEPING); + } PeriodicTaskIF* pusLowPrio = factory->createPeriodicTask( "PUS_LOW_PRIO", 30, PeriodicTaskIF::MINIMUM_STACK_SIZE, 1.6, missedDeadlineFunc); @@ -124,6 +128,11 @@ void initmission::initTasks() { if(result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS17", objects::PUS_SERVICE_17_TEST); } + result = pusLowPrio->addComponent(objects::INTERNAL_ERROR_REPORTER); + if(result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("INT_ERR_RPRT", + objects::INTERNAL_ERROR_REPORTER); + } #if OBSW_ADD_TEST_PST == 1 FixedTimeslotTaskIF* pstTestTask = factory->createFixedTimeslotTask( diff --git a/bsp_linux_board/ObjectFactory.cpp b/bsp_linux_board/ObjectFactory.cpp index 21a2ec07..cefce4cd 100644 --- a/bsp_linux_board/ObjectFactory.cpp +++ b/bsp_linux_board/ObjectFactory.cpp @@ -45,15 +45,13 @@ void Factory::setStaticFrameworkObjectIds() { // No storage object for now. TmFunnel::storageDestination = objects::NO_OBJECT; - LocalDataPoolManager::defaultHkDestination = objects::NO_OBJECT; - VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION; TmPacketBase::timeStamperId = objects::TIME_STAMPER; } -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); diff --git a/bsp_linux_board/ObjectFactory.h b/bsp_linux_board/ObjectFactory.h index f7fa81ac..feaba70e 100644 --- a/bsp_linux_board/ObjectFactory.h +++ b/bsp_linux_board/ObjectFactory.h @@ -1,17 +1,10 @@ -/* - * ObjectFactory.h - * - * Created on: Sep 22, 2020 - * Author: steffen - */ - #ifndef BSP_LINUX_OBJECTFACTORY_H_ #define BSP_LINUX_OBJECTFACTORY_H_ namespace ObjectFactory { void setStatics(); - void produce(); + void produce(void* args); }; #endif /* BSP_LINUX_OBJECTFACTORY_H_ */ diff --git a/bsp_linux_board/boardconfig/CMakeLists.txt b/bsp_linux_board/boardconfig/CMakeLists.txt index c32b326d..67fbaf88 100644 --- a/bsp_linux_board/boardconfig/CMakeLists.txt +++ b/bsp_linux_board/boardconfig/CMakeLists.txt @@ -5,6 +5,3 @@ target_sources(${TARGET_NAME} PRIVATE target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) - - - diff --git a/bsp_linux_board/boardconfig/rpi_config.h b/bsp_linux_board/boardconfig/rpiConfig.h.in similarity index 100% rename from bsp_linux_board/boardconfig/rpi_config.h rename to bsp_linux_board/boardconfig/rpiConfig.h.in diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index f741a46b..ce790656 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -8,6 +8,4 @@ add_subdirectory(boardconfig) add_subdirectory(comIF) add_subdirectory(boardtest) add_subdirectory(gpio) - - - +add_subdirectory(core) diff --git a/bsp_q7s/Dockerfile b/bsp_q7s/Dockerfile index 73bdd069..0b4bb80b 100644 --- a/bsp_q7s/Dockerfile +++ b/bsp_q7s/Dockerfile @@ -1,15 +1,18 @@ FROM ubuntu:latest # FROM alpine:latest +ENV TZ=Europe/Berlin +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + RUN apt-get update && apt-get install -y curl cmake g++ # Q7S root filesystem, required for cross-compilation RUN mkdir -p /usr/rootfs; \ - curl https://eive-cloud.irs.uni-stuttgart.de/index.php/s/agnJGYeRf6fw2ci/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \ + curl --tlsv1 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/dnfMy9kGpgynN6J/download/cortexa9hf-neon-xiphos-linux-gnueabi.tar.gz \ | tar xvz -C /usr/rootfs # Q7S C++ cross-compiler RUN mkdir -p /usr/tools; \ - curl https://eive-cloud.irs.uni-stuttgart.de/index.php/s/2Fp2ag6NGnbtAsK/download/gcc-arm-linux-gnueabi.tar.gz \ + curl --tlsv1 https://eive-cloud.irs.uni-stuttgart.de/index.php/s/RMsbHydJc6PSqcz/download/gcc-arm-linux-gnueabi.tar.gz \ | tar xvz -C /usr/tools # RUN apk add cmake make g++ diff --git a/bsp_q7s/InitMission.cpp b/bsp_q7s/InitMission.cpp index ce385037..cc3ea26e 100644 --- a/bsp_q7s/InitMission.cpp +++ b/bsp_q7s/InitMission.cpp @@ -33,9 +33,9 @@ ObjectManagerIF *objectManager = nullptr; void initmission::initMission() { sif::info << "Building global objects.." << std::endl; /* Instantiate global object manager and also create all objects */ - objectManager = new ObjectManager(ObjectFactory::produce); + ObjectManager::instance()->setObjectFactoryFunction(ObjectFactory::produce, nullptr); sif::info << "Initializing all objects.." << std::endl; - objectManager->initialize(); + ObjectManager::instance()->initialize(); /* This function creates and starts all tasks */ initTasks(); diff --git a/bsp_q7s/ObjectFactory.cpp b/bsp_q7s/ObjectFactory.cpp index 6629c0bd..33314297 100644 --- a/bsp_q7s/ObjectFactory.cpp +++ b/bsp_q7s/ObjectFactory.cpp @@ -7,11 +7,15 @@ #include "devices/powerSwitcherList.h" #include "spiConf.h" -#include +#include "bsp_q7s/gpio/gpioCallbacks.h" +#include "bsp_q7s/core/CoreController.h" #include #include +#include #include +#include +#include #include #include @@ -28,8 +32,6 @@ #include #include #include - -#include #include #include #include @@ -37,13 +39,8 @@ #include #include -#include -#include - -#include -#include - - +#include "fsfw_hal/linux/uart/UartComIF.h" +#include "fsfw_hal/linux/uart/UartCookie.h" #include #include #include @@ -84,9 +81,20 @@ void Factory::setStaticFrameworkObjectIds() { -void ObjectFactory::produce(){ +void ObjectFactory::produce(void* args){ Factory::setStaticFrameworkObjectIds(); ObjectFactory::produceGenericObjects(); + LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); + + /* Communication interfaces */ + new CspComIF(objects::CSP_COM_IF); + new I2cComIF(objects::I2C_COM_IF); + new UartComIF(objects::UART_COM_IF); +#if Q7S_ADD_SPI_TEST == 0 + new SpiComIF(objects::SPI_COM_IF, gpioComIF); +#endif /* Q7S_ADD_SPI_TEST == 0 */ + + new CoreController(objects::CORE_CONTROLLER); #if TE0720 == 1 I2cCookie* i2cCookieTmp1075tcs1 = new I2cCookie(addresses::TMP1075_TCS_1, @@ -99,15 +107,6 @@ void ObjectFactory::produce(){ I2cCookie* i2cCookieTmp1075tcs2 = new I2cCookie(addresses::TMP1075_TCS_2, TMP1075::MAX_REPLY_LENGTH, std::string("/dev/i2c-1")); #endif - LinuxLibgpioIF* gpioComIF = new LinuxLibgpioIF(objects::GPIO_IF); - - /* Communication interfaces */ - new CspComIF(objects::CSP_COM_IF); - new I2cComIF(objects::I2C_COM_IF); - new UartComIF(objects::UART_COM_IF); -#if Q7S_ADD_SPI_TEST == 0 - new SpiComIF(objects::SPI_COM_IF, gpioComIF); -#endif /* Q7S_ADD_SPI_TEST == 0 */ /* Temperature sensors */ Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler( diff --git a/bsp_q7s/ObjectFactory.h b/bsp_q7s/ObjectFactory.h index 38ec0e9e..536af52d 100644 --- a/bsp_q7s/ObjectFactory.h +++ b/bsp_q7s/ObjectFactory.h @@ -3,7 +3,7 @@ namespace ObjectFactory { void setStatics(); -void produce(); +void produce(void* args); }; #endif /* BSP_Q7S_OBJECTFACTORY_H_ */ diff --git a/bsp_q7s/boardconfig/CMakeLists.txt b/bsp_q7s/boardconfig/CMakeLists.txt index c32b326d..67fbaf88 100644 --- a/bsp_q7s/boardconfig/CMakeLists.txt +++ b/bsp_q7s/boardconfig/CMakeLists.txt @@ -5,6 +5,3 @@ target_sources(${TARGET_NAME} PRIVATE target_include_directories(${TARGET_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) - - - diff --git a/bsp_q7s/boardconfig/q7s_config.h b/bsp_q7s/boardconfig/q7sConfig.h.in similarity index 100% rename from bsp_q7s/boardconfig/q7s_config.h rename to bsp_q7s/boardconfig/q7sConfig.h.in diff --git a/bsp_q7s/core/CMakeLists.txt b/bsp_q7s/core/CMakeLists.txt new file mode 100644 index 00000000..4b2364c1 --- /dev/null +++ b/bsp_q7s/core/CMakeLists.txt @@ -0,0 +1,3 @@ +target_sources(${TARGET_NAME} PRIVATE + CoreController.cpp +) diff --git a/bsp_q7s/core/CoreController.cpp b/bsp_q7s/core/CoreController.cpp new file mode 100644 index 00000000..253efd91 --- /dev/null +++ b/bsp_q7s/core/CoreController.cpp @@ -0,0 +1,26 @@ +#include "CoreController.h" + +CoreController::CoreController(object_id_t objectId): + ExtendedControllerBase(objectId, objects::NO_OBJECT, 5) { +} + +ReturnValue_t CoreController::handleCommandMessage(CommandMessage *message) { + return HasReturnvaluesIF::RETURN_OK; +} + +void CoreController::performControlOperation() { +} + +ReturnValue_t CoreController::initializeLocalDataPool(localpool::DataPool &localDataPoolMap, + LocalDataPoolManager &poolManager) { + return HasReturnvaluesIF::RETURN_OK; +} + +LocalPoolDataSetBase* CoreController::getDataSetHandle(sid_t sid) { + return nullptr; +} + +ReturnValue_t CoreController::checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode) { + return HasReturnvaluesIF::RETURN_OK; +} diff --git a/bsp_q7s/core/CoreController.h b/bsp_q7s/core/CoreController.h new file mode 100644 index 00000000..bc8a1581 --- /dev/null +++ b/bsp_q7s/core/CoreController.h @@ -0,0 +1,22 @@ +#ifndef BSP_Q7S_CORE_CORECONTROLLER_H_ +#define BSP_Q7S_CORE_CORECONTROLLER_H_ + +#include "fsfw/controller/ExtendedControllerBase.h" + +class CoreController: public ExtendedControllerBase { +public: + CoreController(object_id_t objectId); + + ReturnValue_t handleCommandMessage(CommandMessage *message) override; + void performControlOperation() override; +private: + ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap, + LocalDataPoolManager& poolManager) override; + LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; + ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode, + uint32_t *msToReachTheMode); +}; + + + +#endif /* BSP_Q7S_CORE_CORECONTROLLER_H_ */ diff --git a/bsp_q7s/memory/CMakeLists.txt b/bsp_q7s/memory/CMakeLists.txt new file mode 100644 index 00000000..2ccdc7e2 --- /dev/null +++ b/bsp_q7s/memory/CMakeLists.txt @@ -0,0 +1,4 @@ +target_sources(${TARGET_NAME} PRIVATE + FileSystemManager.cpp + SdCardAccess.cpp +) \ No newline at end of file diff --git a/bsp_q7s/memory/FileSystemManager.cpp b/bsp_q7s/memory/FileSystemManager.cpp new file mode 100644 index 00000000..40c8e58a --- /dev/null +++ b/bsp_q7s/memory/FileSystemManager.cpp @@ -0,0 +1,7 @@ +#include "FileSystemManager.h" + +class FileSystemManager { +public: + +private: +}; diff --git a/bsp_q7s/memory/FileSystemManager.h b/bsp_q7s/memory/FileSystemManager.h new file mode 100644 index 00000000..4fc8dc52 --- /dev/null +++ b/bsp_q7s/memory/FileSystemManager.h @@ -0,0 +1,8 @@ +#ifndef BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ +#define BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ + + + + + +#endif /* BSP_Q7S_MEMORY_FILESYSTEMMANAGER_H_ */ diff --git a/bsp_q7s/memory/SdCardAccess.cpp b/bsp_q7s/memory/SdCardAccess.cpp new file mode 100644 index 00000000..3d5f12b9 --- /dev/null +++ b/bsp_q7s/memory/SdCardAccess.cpp @@ -0,0 +1,4 @@ +#include "SdCardAccess.h" + +SdCardAccess::SdCardAccess() { +} diff --git a/bsp_q7s/memory/SdCardAccess.h b/bsp_q7s/memory/SdCardAccess.h new file mode 100644 index 00000000..ba273d09 --- /dev/null +++ b/bsp_q7s/memory/SdCardAccess.h @@ -0,0 +1,11 @@ +#ifndef BSP_Q7S_MEMORY_SDCARDACCESS_H_ +#define BSP_Q7S_MEMORY_SDCARDACCESS_H_ + +class SdCardAccess { +public: + SdCardAccess(); +private: +}; + + +#endif /* BSP_Q7S_MEMORY_SDCARDACCESS_H_ */ diff --git a/cmake/Q7SCrossCompileConfig.cmake b/cmake/Q7SCrossCompileConfig.cmake index 66d9e0a8..bc95a909 100644 --- a/cmake/Q7SCrossCompileConfig.cmake +++ b/cmake/Q7SCrossCompileConfig.cmake @@ -6,7 +6,7 @@ if(NOT DEFINED ENV{Q7S_SYSROOT}) # "point to the raspbian rootfs." # ) else() - set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}" CACHE FILEPATH "Q7S root filesystem path") + set(SYSROOT_PATH "$ENV{Q7S_SYSROOT}" CACHE PATH "Q7S root filesystem path") endif() if(NOT DEFINED ENV{CROSS_COMPILE}) diff --git a/common/config/commonClassIds.h b/common/config/commonClassIds.h index 2834cd2e..8ec68622 100644 --- a/common/config/commonClassIds.h +++ b/common/config/commonClassIds.h @@ -6,7 +6,7 @@ namespace CLASS_ID { enum commonClassIds: uint8_t { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, + COMMON_CLASS_ID_START = FW_CLASS_ID_COUNT, MGM_LIS3MDL, //MGMLIS3 MGM_RM3100, //MGMRM3100 PCDU_HANDLER, //PCDU diff --git a/common/config/commonConfig.h b/common/config/commonConfig.h.in similarity index 100% rename from common/config/commonConfig.h rename to common/config/commonConfig.h.in diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index fd7e5a92..3baf58b0 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -11,6 +11,12 @@ enum commonObjects: uint32_t { UDP_BRIDGE = 0x50000300, UDP_POLLING_TASK = 0x50000400, + /* 0x43 ('C') for Controllers */ + THERMAL_CONTROLLER = 0x43001000, + ATTITUDE_CONTROLLER = 0x43002000, + ACS_CONTROLLER = 0x43003000, + CORE_CONTROLLER = 0x43004000, + /* 0x44 ('D') for device handlers */ P60DOCK_HANDLER = 0x44000001, PDU1_HANDLER = 0x44000002, diff --git a/docker-compose.yml b/docker-compose.yml index 66073617..48acea6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.8" +version: "3.3" services: build-host: diff --git a/fsfw b/fsfw index e9adaf67..4b095eea 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit e9adaf672f7bfac9aaa03c284410b318142431ff +Subproject commit 4b095eea8991d3e9a48fa8945c86339cfdad26d5 diff --git a/generators/events/event_parser.py b/generators/events/event_parser.py index fa52f938..565f2240 100644 --- a/generators/events/event_parser.py +++ b/generators/events/event_parser.py @@ -11,10 +11,10 @@ On Windows, Build Tools installation might be necessary """ import datetime -from modgen.events.event_parser import handle_csv_export, handle_cpp_export, SubsystemDefinitionParser, EventParser -from modgen.parserbase.file_list_parser import FileListParser -from modgen.utility.printer import PrettyPrinter -from modgen.utility.file_management import copy_file, move_file +from fsfwgen.events.event_parser import handle_csv_export, handle_cpp_export, SubsystemDefinitionParser, EventParser +from fsfwgen.parserbase.file_list_parser import FileListParser +from fsfwgen.utility.printer import PrettyPrinter +from fsfwgen.utility.file_management import copy_file, move_file from definitions import BspType diff --git a/generators/events/translateEvents.cpp b/generators/events/translateEvents.cpp index 8fb7d4e8..c3af08e1 100644 --- a/generators/events/translateEvents.cpp +++ b/generators/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 83 translations. * @details - * Generated on: 2021-05-18 16:15:50 + * Generated on: 2021-06-08 17:09:32 */ #include "translateEvents.h" diff --git a/generators/fsfwgen b/generators/fsfwgen new file mode 160000 index 00000000..78e890f9 --- /dev/null +++ b/generators/fsfwgen @@ -0,0 +1 @@ +Subproject commit 78e890f947f55a9417d390fea8d9bd5684d11730 diff --git a/generators/modgen b/generators/modgen deleted file mode 160000 index d9beb68b..00000000 --- a/generators/modgen +++ /dev/null @@ -1 +0,0 @@ -Subproject commit d9beb68bd9d1a1e6015e4979d547a762d199bff7 diff --git a/generators/objects/objects.py b/generators/objects/objects.py index c7df218e..d37b80d7 100644 --- a/generators/objects/objects.py +++ b/generators/objects/objects.py @@ -10,10 +10,10 @@ On Windows, Build Tools installation might be necessary """ import datetime -from modgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, write_translation_file, \ +from fsfwgen.objects.objects import sql_object_exporter, ObjectDefinitionParser, write_translation_file, \ export_object_file, write_translation_header_file -from modgen.utility.printer import PrettyPrinter -from modgen.utility.file_management import copy_file, move_file +from fsfwgen.utility.printer import PrettyPrinter +from fsfwgen.utility.file_management import copy_file, move_file from definitions import BspType, DATABASE_NAME diff --git a/generators/returnvalues/returnvalues_parser.py b/generators/returnvalues/returnvalues_parser.py index 24bbd54b..772e0bf1 100644 --- a/generators/returnvalues/returnvalues_parser.py +++ b/generators/returnvalues/returnvalues_parser.py @@ -9,10 +9,10 @@ Returnvalue exporter. To use MySQLdb, run pip install mysqlclient or install in IDE. On Windows, Build Tools installation might be necessary. :data: 21.11.2019 """ -from modgen.parserbase.file_list_parser import FileListParser -from modgen.returnvalues.returnvalues_parser import InterfaceParser, ReturnValueParser -from modgen.utility.sql_writer import SqlWriter -from modgen.utility.file_management import move_file +from fsfwgen.parserbase.file_list_parser import FileListParser +from fsfwgen.returnvalues.returnvalues_parser import InterfaceParser, ReturnValueParser +from fsfwgen.utility.sql_writer import SqlWriter +from fsfwgen.utility.file_management import move_file from definitions import BspType, DATABASE_NAME diff --git a/linux/boardtest/LibgpiodTest.cpp b/linux/boardtest/LibgpiodTest.cpp index 3aa9c22a..39e863b4 100644 --- a/linux/boardtest/LibgpiodTest.cpp +++ b/linux/boardtest/LibgpiodTest.cpp @@ -3,14 +3,14 @@ #include "devices/gpioIds.h" #include -#include +#include #include LibgpiodTest::LibgpiodTest(object_id_t objectId, object_id_t gpioIfobjectId, GpioCookie* gpioCookie): TestTask(objectId) { - gpioInterface = objectManager->get(gpioIfobjectId); + gpioInterface = ObjectManager::instance()->get(gpioIfobjectId); if (gpioInterface == nullptr) { sif::error << "LibgpiodTest::LibgpiodTest: Invalid Gpio interface." << std::endl; } diff --git a/linux/devices/HeaterHandler.cpp b/linux/devices/HeaterHandler.cpp index 6f38eb52..60a60328 100644 --- a/linux/devices/HeaterHandler.cpp +++ b/linux/devices/HeaterHandler.cpp @@ -2,6 +2,7 @@ #include "devices/gpioIds.h" #include "devices/powerSwitcherList.h" +#include #include #include @@ -38,7 +39,7 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = objectManager->get(gpioDriverId); + gpioInterface = ObjectManager::instance()->get(gpioDriverId); if (gpioInterface == nullptr) { sif::error << "HeaterHandler::initialize: Invalid Gpio interface." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; @@ -50,14 +51,14 @@ ReturnValue_t HeaterHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == nullptr) { sif::error << "HeaterHandler::initialize: IPC store not set up in factory." << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; } if(mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = objectManager->get(mainLineSwitcherObjectId); + mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); if (mainLineSwitcher == nullptr) { sif::error << "HeaterHandler::initialize: Failed to get main line switcher. Make sure " diff --git a/linux/devices/SolarArrayDeploymentHandler.cpp b/linux/devices/SolarArrayDeploymentHandler.cpp index 25be3927..eea546f6 100644 --- a/linux/devices/SolarArrayDeploymentHandler.cpp +++ b/linux/devices/SolarArrayDeploymentHandler.cpp @@ -5,6 +5,7 @@ #include #include +#include SolarArrayDeploymentHandler::SolarArrayDeploymentHandler(object_id_t setObjectId_, @@ -35,7 +36,7 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } - gpioInterface = objectManager->get(gpioDriverId); + gpioInterface = ObjectManager::instance()->get(gpioDriverId); if (gpioInterface == nullptr) { sif::error << "SolarArrayDeploymentHandler::initialize: Invalid Gpio interface." << std::endl; @@ -50,7 +51,7 @@ ReturnValue_t SolarArrayDeploymentHandler::initialize() { } if (mainLineSwitcherObjectId != objects::NO_OBJECT) { - mainLineSwitcher = objectManager->get(mainLineSwitcherObjectId); + mainLineSwitcher = ObjectManager::instance()->get(mainLineSwitcherObjectId); if (mainLineSwitcher == nullptr) { sif::error << "SolarArrayDeploymentHandler::initialize: Main line switcher failed to fetch object" diff --git a/linux/fsfwconfig/FSFWConfig.h b/linux/fsfwconfig/FSFWConfig.h.in similarity index 100% rename from linux/fsfwconfig/FSFWConfig.h rename to linux/fsfwconfig/FSFWConfig.h.in diff --git a/linux/fsfwconfig/OBSWConfig.h b/linux/fsfwconfig/OBSWConfig.h.in similarity index 97% rename from linux/fsfwconfig/OBSWConfig.h rename to linux/fsfwconfig/OBSWConfig.h.in index c4441eef..82a57e39 100644 --- a/linux/fsfwconfig/OBSWConfig.h +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -7,9 +7,9 @@ #define FSFWCONFIG_OBSWCONFIG_H_ #ifdef RASPBERRY_PI -#include +#include "rpiConfig.h" #elif defined(XIPHOS_Q7S) -#include +#include "q7sConfig.h" #endif #include "commonConfig.h" #include "OBSWVersion.h" diff --git a/linux/fsfwconfig/events/translateEvents.cpp b/linux/fsfwconfig/events/translateEvents.cpp index 8fb7d4e8..c3af08e1 100644 --- a/linux/fsfwconfig/events/translateEvents.cpp +++ b/linux/fsfwconfig/events/translateEvents.cpp @@ -1,7 +1,7 @@ /** * @brief Auto-generated event translation file. Contains 83 translations. * @details - * Generated on: 2021-05-18 16:15:50 + * Generated on: 2021-06-08 17:09:32 */ #include "translateEvents.h" diff --git a/linux/fsfwconfig/objects/systemObjectList.h b/linux/fsfwconfig/objects/systemObjectList.h index 95730e09..3f7fddc4 100644 --- a/linux/fsfwconfig/objects/systemObjectList.h +++ b/linux/fsfwconfig/objects/systemObjectList.h @@ -1,9 +1,9 @@ #ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ #define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ -#include +#include "commonObjects.h" #include -#include +#include // The objects will be instantiated in the ID order namespace objects { @@ -12,12 +12,7 @@ namespace objects { FW_ADDRESS_START = PUS_SERVICE_1_VERIFICATION, FW_ADDRESS_END = TIME_STAMPER, - PUS_SERVICE_3 = 0x51000300, - PUS_SERVICE_5 = 0x51000400, PUS_SERVICE_6 = 0x51000500, - PUS_SERVICE_8 = 0x51000800, - PUS_SERVICE_23 = 0x51002300, - PUS_SERVICE_201 = 0x51020100, TM_FUNNEL = 0x52000002, diff --git a/misc/archive/GPIORPi.cpp b/misc/archive/GPIORPi.cpp index 74b67a42..34d0f69a 100644 --- a/misc/archive/GPIORPi.cpp +++ b/misc/archive/GPIORPi.cpp @@ -1,7 +1,6 @@ #include "GPIORPi.h" -#include - #include +#include #include ReturnValue_t gpio::createRpiGpioConfig(GpioCookie* cookie, gpioId_t gpioId, int bcmPin, diff --git a/mission/controller/ThermalController.cpp b/mission/controller/ThermalController.cpp index 7d889993..538e63f3 100644 --- a/mission/controller/ThermalController.cpp +++ b/mission/controller/ThermalController.cpp @@ -30,7 +30,7 @@ ReturnValue_t ThermalController::initializeAfterTaskCreation() { sif::error << "ThermalController::initializeAfterTaskCreation: Base" << " class initialization failed!" << std::endl; } - HasLocalDataPoolIF* testHkbHandler = objectManager->get( + HasLocalDataPoolIF* testHkbHandler = ObjectManager::instance()->get( TSensorDefinitions::ObjIds::TEST_HKB_HANDLER); if(testHkbHandler == nullptr) { sif::warning << "ThermalController::initializeAfterTaskCreation: Test" diff --git a/mission/devices/GyroADIS16507Handler.cpp b/mission/devices/GyroADIS16507Handler.cpp index 3c4639a0..2c3ed5a4 100644 --- a/mission/devices/GyroADIS16507Handler.cpp +++ b/mission/devices/GyroADIS16507Handler.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -14,7 +15,7 @@ GyroADIS16507Handler::GyroADIS16507Handler(object_id_t objectId, object_id_t deviceCommunication, CookieIF * comCookie): DeviceHandlerBase(objectId, deviceCommunication, comCookie), primaryDataset(this), - configDataset(this) { + configDataset(this), breakCountdown() { #if ADIS16507_DEBUG == 1 debugDivider = new PeriodicOperationDivider(5); #endif @@ -28,18 +29,34 @@ GyroADIS16507Handler::GyroADIS16507Handler(object_id_t objectId, } void GyroADIS16507Handler::doStartUp() { + // Initial 310 ms start up time after power-up if(internalState == InternalState::STARTUP) { + if(not commandExecuted) { + breakCountdown.setTimeout(ADIS16507::START_UP_TIME); + commandExecuted = true; + } + if(breakCountdown.hasTimedOut()) { + internalState = InternalState::CONFIG; + commandExecuted = false; + } + } + + // Read all configuration registers first + if(internalState == InternalState::CONFIG) { if(commandExecuted) { commandExecuted = false; internalState = InternalState::IDLE; } } + if(internalState == InternalState::IDLE) { setMode(MODE_NORMAL); + // setMode(MODE_ON); } } void GyroADIS16507Handler::doShutDown() { + commandExecuted = false; } ReturnValue_t GyroADIS16507Handler::buildNormalDeviceCommand(DeviceCommandId_t *id) { @@ -49,11 +66,14 @@ ReturnValue_t GyroADIS16507Handler::buildNormalDeviceCommand(DeviceCommandId_t * ReturnValue_t GyroADIS16507Handler::buildTransitionDeviceCommand(DeviceCommandId_t *id) { switch(internalState) { - case(InternalState::STARTUP): { + case(InternalState::CONFIG): { *id = ADIS16507::READ_OUT_CONFIG; buildCommandFromCommand(*id, nullptr, 0); break; } + case(InternalState::STARTUP): { + break; + } default: { /* Might be a configuration error. */ sif::debug << "GyroADIS16507Handler::buildTransitionDeviceCommand: " @@ -80,6 +100,10 @@ ReturnValue_t GyroADIS16507Handler::buildCommandFromCommand(DeviceCommandId_t de break; } case(ADIS16507::READ_SENSOR_DATA): { + if(breakCountdown.isBusy()) { + // A glob command is pending and sensor data can't be read currently + return NO_REPLY_EXPECTED; + } std::memcpy(commandBuffer.data(), ADIS16507::BURST_READ_ENABLE.data(), ADIS16507::BURST_READ_ENABLE.size()); std::memset(commandBuffer.data() + 2, 0, 10 * 2); @@ -87,6 +111,62 @@ ReturnValue_t GyroADIS16507Handler::buildCommandFromCommand(DeviceCommandId_t de this->rawPacket = commandBuffer.data(); break; } + case(ADIS16507::SELF_TEST_SENSORS): { + if(breakCountdown.isBusy()) { + // Another glob command is pending + return HasActionsIF::IS_BUSY; + } + prepareWriteCommand(ADIS16507::GLOB_CMD, ADIS16507::GlobCmds::SENSOR_SELF_TEST, 0x00); + breakCountdown.setTimeout(ADIS16507::SELF_TEST_BREAK); + break; + } + case(ADIS16507::SELF_TEST_MEMORY): { + if(breakCountdown.isBusy()) { + // Another glob command is pending + return HasActionsIF::IS_BUSY; + } + prepareWriteCommand(ADIS16507::GLOB_CMD, ADIS16507::GlobCmds::FLASH_MEMORY_TEST, 0x00); + breakCountdown.setTimeout(ADIS16507::FLASH_MEMORY_TEST_BREAK); + break; + } + case(ADIS16507::UPDATE_NV_CONFIGURATION): { + if(breakCountdown.isBusy()) { + // Another glob command is pending + return HasActionsIF::IS_BUSY; + } + prepareWriteCommand(ADIS16507::GLOB_CMD, ADIS16507::GlobCmds::FLASH_MEMORY_UPDATE, 0x00); + breakCountdown.setTimeout(ADIS16507::FLASH_MEMORY_UPDATE_BREAK); + break; + } + case(ADIS16507::RESET_SENSOR_CONFIGURATION): { + if(breakCountdown.isBusy()) { + // Another glob command is pending + return HasActionsIF::IS_BUSY; + } + prepareWriteCommand(ADIS16507::GLOB_CMD, ADIS16507::GlobCmds::FACTORY_CALIBRATION, 0x00); + breakCountdown.setTimeout(ADIS16507::FACTORY_CALIBRATION_BREAK); + break; + } + case(ADIS16507::SW_RESET): { + if(breakCountdown.isBusy()) { + // Another glob command is pending + return HasActionsIF::IS_BUSY; + } + prepareWriteCommand(ADIS16507::GLOB_CMD, ADIS16507::GlobCmds::SOFTWARE_RESET, 0x00); + breakCountdown.setTimeout(ADIS16507::SW_RESET_BREAK); + break; + } + case(ADIS16507::PRINT_CURRENT_CONFIGURATION): { +#if OBSW_VERBOSE_LEVEL >= 1 + PoolReadGuard pg(&configDataset); + sif::info << "ADIS16507 Sensor configuration: DIAG_STAT: 0x" << std::hex << std::setw(4) << + std::setfill('0') << "0x" << configDataset.diagStatReg.value << std::endl; + sif::info << "MSC_CTRL: " << std::hex << std::setw(4) << "0x" << + configDataset.mscCtrlReg.value << " | FILT_CTRL: 0x" << + configDataset.filterSetting.value << " | DEC_RATE: 0x" << + configDataset.decRateReg.value << std::setfill(' ') << std::endl; +#endif /* OBSW_VERBOSE_LEVEL >= 1 */ + } } return HasReturnvaluesIF::RETURN_OK; } @@ -94,6 +174,12 @@ ReturnValue_t GyroADIS16507Handler::buildCommandFromCommand(DeviceCommandId_t de void GyroADIS16507Handler::fillCommandAndReplyMap() { insertInCommandAndReplyMap(ADIS16507::READ_SENSOR_DATA, 1, &primaryDataset); insertInCommandAndReplyMap(ADIS16507::READ_OUT_CONFIG, 1, &configDataset); + insertInCommandAndReplyMap(ADIS16507::SELF_TEST_SENSORS, 1); + insertInCommandAndReplyMap(ADIS16507::SELF_TEST_MEMORY, 1); + insertInCommandAndReplyMap(ADIS16507::UPDATE_NV_CONFIGURATION, 1); + insertInCommandAndReplyMap(ADIS16507::RESET_SENSOR_CONFIGURATION, 1); + insertInCommandAndReplyMap(ADIS16507::SW_RESET, 1); + insertInCommandAndReplyMap(ADIS16507::PRINT_CURRENT_CONFIGURATION, 1); } ReturnValue_t GyroADIS16507Handler::scanForReply(const uint8_t *start, size_t remainingSize, @@ -123,7 +209,7 @@ ReturnValue_t GyroADIS16507Handler::interpretDeviceReply(DeviceCommandId_t id, configDataset.mscCtrlReg.value = packet[6] << 8 | packet[7]; configDataset.decRateReg.value = packet[8] << 8 | packet[9]; configDataset.setValidity(true, true); - if(internalState == InternalState::STARTUP) { + if(internalState == InternalState::CONFIG) { commandExecuted = true; } break; @@ -223,6 +309,19 @@ uint32_t GyroADIS16507Handler::getTransitionDelayMs(Mode_t modeFrom, Mode_t mode return 5000; } +void GyroADIS16507Handler::prepareWriteCommand(uint8_t startReg, uint8_t valueOne, + uint8_t valueTwo) { + uint8_t secondReg = startReg + 1; + startReg |= ADIS16507::WRITE_MASK; + secondReg |= ADIS16507::WRITE_MASK; + commandBuffer[0] = startReg; + commandBuffer[1] = valueOne; + commandBuffer[2] = secondReg; + commandBuffer[3] = valueTwo; + this->rawPacketLen = 4; + this->rawPacket = commandBuffer.data(); +} + void GyroADIS16507Handler::prepareReadCommand(uint8_t *regList, size_t len) { for(size_t idx = 0; idx < len; idx++) { commandBuffer[idx * 2] = regList[idx]; diff --git a/mission/devices/GyroADIS16507Handler.h b/mission/devices/GyroADIS16507Handler.h index fbb9f7bf..653f56e7 100644 --- a/mission/devices/GyroADIS16507Handler.h +++ b/mission/devices/GyroADIS16507Handler.h @@ -40,6 +40,7 @@ private: enum class InternalState { STARTUP, + CONFIG, IDLE }; @@ -65,6 +66,8 @@ private: #if ADIS16507_DEBUG == 1 PeriodicOperationDivider* debugDivider; #endif + Countdown breakCountdown; + void prepareWriteCommand(uint8_t startReg, uint8_t valueOne, uint8_t valueTwo); ReturnValue_t handleSensorData(const uint8_t* packet); }; diff --git a/mission/devices/PCDUHandler.cpp b/mission/devices/PCDUHandler.cpp index 5812c8bf..3ba734fb 100644 --- a/mission/devices/PCDUHandler.cpp +++ b/mission/devices/PCDUHandler.cpp @@ -33,7 +33,7 @@ ReturnValue_t PCDUHandler::initialize() { ReturnValue_t result; - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); if (IPCStore == nullptr) { return ObjectManagerIF::CHILD_INIT_FAILED; } @@ -44,7 +44,8 @@ ReturnValue_t PCDUHandler::initialize() { } /* Subscribing for housekeeping table update messages of the PDU2 */ - HasLocalDataPoolIF* pdu2Handler = objectManager->get(objects::PDU2_HANDLER); + HasLocalDataPoolIF* pdu2Handler = ObjectManager::instance()->get( + objects::PDU2_HANDLER); if(pdu2Handler == nullptr) { sif::error << "PCDUHandler::initialize: Invalid pdu2Handler" << std::endl; return RETURN_FAILED; @@ -58,7 +59,8 @@ ReturnValue_t PCDUHandler::initialize() { } /* Subscribing for housekeeping table update messages of the PDU1 */ - HasLocalDataPoolIF* pdu1Handler = objectManager->get(objects::PDU1_HANDLER); + HasLocalDataPoolIF* pdu1Handler = ObjectManager::instance()->get( + objects::PDU1_HANDLER); if(pdu1Handler == nullptr) { sif::error << "PCDUHandler::initialize: Invalid pdu1Handler" << std::endl; return RETURN_FAILED; @@ -207,11 +209,11 @@ void PCDUHandler::sendSwitchCommand(uint8_t switchNr, ReturnValue_t onOff) const switch (switchNr) { case pcduSwitches::TCS_BOARD_8V_HEATER_IN: memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_TCS_BOARD_HEATER_IN; - pdu = objectManager->get(objects::PDU2_HANDLER); + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; case pcduSwitches::DEPLOYMENT_MECHANISM: memoryAddress = PDU2::CONFIG_ADDRESS_OUT_EN_DEPLOYMENT_MECHANISM; - pdu = objectManager->get(objects::PDU2_HANDLER); + pdu = ObjectManager::instance()->get(objects::PDU2_HANDLER); break; default: sif::error << "PCDUHandler::sendSwitchCommand: Invalid switch number " << std::endl; diff --git a/mission/devices/devicedefinitions/GyroADIS16507Definitions.h b/mission/devices/devicedefinitions/GyroADIS16507Definitions.h index 1328c99e..a7970b81 100644 --- a/mission/devices/devicedefinitions/GyroADIS16507Definitions.h +++ b/mission/devices/devicedefinitions/GyroADIS16507Definitions.h @@ -8,6 +8,7 @@ namespace ADIS16507 { static constexpr size_t MAXIMUM_REPLY_SIZE = 64; +static constexpr uint8_t WRITE_MASK = 0b1000'0000; static constexpr uint32_t GYRO_RANGE = 125; static constexpr uint32_t ACCELEROMETER_RANGE = 392; @@ -18,6 +19,13 @@ static constexpr uint16_t PROD_ID = 16507; static constexpr std::array BURST_READ_ENABLE = {0x68, 0x00}; +static constexpr dur_millis_t START_UP_TIME = 310; +static constexpr dur_millis_t SW_RESET_BREAK = 255; +static constexpr dur_millis_t FACTORY_CALIBRATION_BREAK = 136; +static constexpr dur_millis_t FLASH_MEMORY_UPDATE_BREAK = 70; +static constexpr dur_millis_t FLASH_MEMORY_TEST_BREAK = 30; +static constexpr dur_millis_t SELF_TEST_BREAK = 24; + static constexpr uint8_t DIAG_STAT_REG = 0x02; static constexpr uint8_t FILTER_CTRL_REG = 0x5c; static constexpr uint8_t MSC_CTRL_REG = 0x60; @@ -47,6 +55,14 @@ static constexpr size_t SENSOR_READOUT_SIZE = 20 + 2; static constexpr uint32_t ADIS_DATASET_ID = READ_SENSOR_DATA; static constexpr uint32_t ADIS_CFG_DATASET_ID = READ_OUT_CONFIG; +enum GlobCmds: uint8_t { + FACTORY_CALIBRATION = 0b0000'0010, + SENSOR_SELF_TEST = 0b0000'0100, + FLASH_MEMORY_UPDATE = 0b0000'1000, + FLASH_MEMORY_TEST = 0b0001'0000, + SOFTWARE_RESET = 0b1000'0000 +}; + enum PrimaryPoolIds: lp_id_t { ANG_VELOC_X, ANG_VELOC_Y, diff --git a/mission/utility/TmFunnel.cpp b/mission/utility/TmFunnel.cpp index a567cbd9..72c41153 100644 --- a/mission/utility/TmFunnel.cpp +++ b/mission/utility/TmFunnel.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -79,7 +80,7 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage* message) { ReturnValue_t TmFunnel::initialize() { - tmPool = objectManager->get(objects::TM_STORE); + tmPool = ObjectManager::instance()->get(objects::TM_STORE); if(tmPool == nullptr) { sif::error << "TmFunnel::initialize: TM store not set." << std::endl; @@ -89,7 +90,7 @@ ReturnValue_t TmFunnel::initialize() { } AcceptsTelemetryIF* tmTarget = - objectManager->get(downlinkDestination); + ObjectManager::instance()->get(downlinkDestination); if(tmTarget == nullptr){ sif::error << "TmFunnel::initialize: Downlink Destination not set." << std::endl; @@ -105,7 +106,7 @@ ReturnValue_t TmFunnel::initialize() { } AcceptsTelemetryIF* storageTarget = - objectManager->get(storageDestination); + ObjectManager::instance()->get(storageDestination); if(storageTarget != nullptr) { storageQueue->setDefaultDestination( storageTarget->getReportReceptionQueue()); diff --git a/test/testtasks/PusTcInjector.cpp b/test/testtasks/PusTcInjector.cpp index b7884cfd..90f2ac75 100644 --- a/test/testtasks/PusTcInjector.cpp +++ b/test/testtasks/PusTcInjector.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include #include @@ -47,7 +47,7 @@ ReturnValue_t PusTcInjector::initialize() { // Prepare message queue which is used to send telecommands. injectionQueue = QueueFactory::instance()-> createMessageQueue(INJECTION_QUEUE_DEPTH); - AcceptsTelecommandsIF* targetQueue = objectManager-> + AcceptsTelecommandsIF* targetQueue = ObjectManager::instance()-> get(destination); if(targetQueue == nullptr) { sif::error << "PusTcInjector: CCSDS distributor not initialized yet!" << std::endl; @@ -58,7 +58,7 @@ ReturnValue_t PusTcInjector::initialize() { } // Prepare store used to store TC messages - tcStore = objectManager->get(tcStoreId); + tcStore = ObjectManager::instance()->get(tcStoreId); if(tcStore == nullptr) { sif::error << "PusTcInjector: TC Store not initialized!" << std::endl; return ObjectManagerIF::CHILD_INIT_FAILED; diff --git a/test/testtasks/TestTask.cpp b/test/testtasks/TestTask.cpp index 88a5d13e..cb185b4a 100644 --- a/test/testtasks/TestTask.cpp +++ b/test/testtasks/TestTask.cpp @@ -1,9 +1,9 @@ #include "TestTask.h" -#include +#include "OBSWConfig.h" #include #include -#include +#include #include #include @@ -13,7 +13,7 @@ TestTask::TestTask(object_id_t objectId_): SystemObject(objectId_), testMode(testModes::A) { - IPCStore = objectManager->get(objects::IPC_STORE); + IPCStore = ObjectManager::instance()->get(objects::IPC_STORE); } TestTask::~TestTask() {