From a13ae7abcc5666e60c6077d498ec6eb32aaed725 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 15 Feb 2023 10:21:35 +0100 Subject: [PATCH] pdec ad frame config, wip --- fsfw | 2 +- linux/ipcore/PdecConfig.cpp | 6 +++++- linux/ipcore/PdecConfig.h | 10 ++-------- linux/ipcore/pdecconfigdefs.h | 20 ++++++++++++++++++++ tmtc | 2 +- 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 linux/ipcore/pdecconfigdefs.h diff --git a/fsfw b/fsfw index 01cc619e..dac2d210 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 01cc619e67b84cef514b045377771ff1e11caf80 +Subproject commit dac2d210b597adfaf45bd5ae6a4c027599927601 diff --git a/linux/ipcore/PdecConfig.cpp b/linux/ipcore/PdecConfig.cpp index 152ea320..173ee477 100644 --- a/linux/ipcore/PdecConfig.cpp +++ b/linux/ipcore/PdecConfig.cpp @@ -1,4 +1,5 @@ #include "PdecConfig.h" +#include "pdecconfigdefs.h" #include "fsfw/serviceinterface/ServiceInterface.h" @@ -74,11 +75,14 @@ void PdecConfig::writeFrameHeaderFirstOctet() { word |= (SPACECRAFT_ID << 16); word |= (VIRTUAL_CHANNEL << 10); word |= (DUMMY_BITS << 8); - word |= positiveWindow; + word |= localParameterHandler.getValue(pdecconfigdefs::paramkeys::POSITIVE_WINDOW, + pdecconfigdefs::defaultvalue::positiveWindow); *(memoryBaseAddress + FRAME_HEADER_OFFSET) = word; } void PdecConfig::writeFrameHeaderSecondOctet() { + uint8_t negativeWindow = localParameterHandler.getValue(pdecconfigdefs::paramkeys::NEGATIVE_WINDOW, + pdecconfigdefs::defaultvalue::negativeWindow); uint32_t word = 0; word = 0; word |= (negativeWindow << 24); diff --git a/linux/ipcore/PdecConfig.h b/linux/ipcore/PdecConfig.h index 0b665c6c..fa471775 100644 --- a/linux/ipcore/PdecConfig.h +++ b/linux/ipcore/PdecConfig.h @@ -1,7 +1,7 @@ #ifndef LINUX_OBC_PDECCONFIG_H_ #define LINUX_OBC_PDECCONFIG_H_ -#include +#include #include "bsp_q7s/memory/LocalParameterHandler.h" #include "bsp_q7s/fs/SdCardManager.h" @@ -49,6 +49,7 @@ class PdecConfig { uint8_t getNegativeWindow(); private: + // TC transfer frame configuration parameters static const uint8_t VERSION_ID = 0; // BD Frames @@ -95,13 +96,6 @@ class PdecConfig { bool enableTcAbortIrq = true; bool enableNewFarIrq = true; - NVMParameterBase persistenParams; - - // Parameters to control the FARM for AD frames - // Set here for future use - uint8_t positiveWindow = 10; - uint8_t negativeWindow = 151; - void writeFrameHeaderFirstOctet(); void writeFrameHeaderSecondOctet(); void writeMapConfig(); diff --git a/linux/ipcore/pdecconfigdefs.h b/linux/ipcore/pdecconfigdefs.h new file mode 100644 index 00000000..bc2cfa8c --- /dev/null +++ b/linux/ipcore/pdecconfigdefs.h @@ -0,0 +1,20 @@ +#ifndef LINUX_IPCORE_PDECCONFIGDEFS_H_ +#define LINUX_IPCORE_PDECCONFIGDEFS_H_ + +#include + +namespace pdecconfigdefs { + +namespace paramkeys { + static const std::string POSITIVE_WINDOW = "positive_window"; + static const std::string NEGATIVE_WINDOW = "negattive_window"; +} + +namespace defaultvalue { + static const uint8_t positiveWindow = 10; + static const uint8_t negativeWindow = 151; +} + +} + +#endif /* LINUX_IPCORE_PDECCONFIGDEFS_H_ */ diff --git a/tmtc b/tmtc index a3a3aaa8..8d036bcd 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit a3a3aaa8836b425c923eb97e49ed29b452377bf6 +Subproject commit 8d036bcd4fed1211ad5b15ddae7b42e61e22fcfd