PDEC Config Persistent #398

Merged
muellerr merged 21 commits from meier/pdec-config-persistent into develop 2023-02-27 18:33:52 +01:00
4 changed files with 15 additions and 5 deletions
Showing only changes of commit 316971c6bc - Show all commits

View File

@ -37,6 +37,7 @@ enum : uint8_t {
CONFIGHANDLER = 139, CONFIGHANDLER = 139,
CORE = 140, CORE = 140,
TCS_CONTROLLER = 141, TCS_CONTROLLER = 141,
COM_SUBSYSTEM = 142,
COMMON_SUBSYSTEM_ID_END COMMON_SUBSYSTEM_ID_END
}; };

View File

@ -187,7 +187,6 @@ ReturnValue_t PdecHandler::irqOperation() {
switch (state) { switch (state) {
case State::INIT: { case State::INIT: {
handleInitState(); handleInitState();
checkLocks();
break; break;
} }
case State::PDEC_RESET: { case State::PDEC_RESET: {
@ -199,6 +198,7 @@ ReturnValue_t PdecHandler::irqOperation() {
break; break;
} }
case State::RUNNING: { case State::RUNNING: {
checkLocks();
checkAndHandleIrqs(fd, info); checkAndHandleIrqs(fd, info);
break; break;
} }
@ -251,7 +251,6 @@ ReturnValue_t PdecHandler::checkAndHandleIrqs(int fd, uint32_t& info) {
int ret = poll(&fds, 1, IRQ_TIMEOUT_MS); int ret = poll(&fds, 1, IRQ_TIMEOUT_MS);
if (ret == 0) { if (ret == 0) {
// No TCs for timeout period // No TCs for timeout period
checkLocks();
genericCheckCd.resetTimer(); genericCheckCd.resetTimer();
resetIrqLimiters(); resetIrqLimiters();
} else if (ret >= 1) { } else if (ret >= 1) {
@ -278,7 +277,6 @@ ReturnValue_t PdecHandler::checkAndHandleIrqs(int fd, uint32_t& info) {
static_cast<void>(dummy); static_cast<void>(dummy);
if (genericCheckCd.hasTimedOut()) { if (genericCheckCd.hasTimedOut()) {
checkLocks();
genericCheckCd.resetTimer(); genericCheckCd.resetTimer();
if (interruptWindowCd.hasTimedOut()) { if (interruptWindowCd.hasTimedOut()) {
if (interruptCounter >= MAX_ALLOWED_IRQS_PER_WINDOW) { if (interruptCounter >= MAX_ALLOWED_IRQS_PER_WINDOW) {

View File

@ -166,6 +166,7 @@ void ComSubsystem::handleBitLockEvent() {
rememberBitLock = true; rememberBitLock = true;
return; return;
} }
triggerEvent(BIT_LOCK_TX_ON);
startRxAndTxLowRateSeq(); startRxAndTxLowRateSeq();
} }
@ -183,6 +184,7 @@ void ComSubsystem::startRxAndTxLowRateSeq() {
void ComSubsystem::checkTransmitterCountdown() { void ComSubsystem::checkTransmitterCountdown() {
if (transmitterCountdown.hasTimedOut()) { if (transmitterCountdown.hasTimedOut()) {
triggerEvent(TX_TIMER_EXPIRED, transmitterTimeout);
startTransition(com::Submode::RX_ONLY, SUBMODE_NONE); startTransition(com::Submode::RX_ONLY, SUBMODE_NONE);
countdownActive = false; countdownActive = false;
} }

View File

@ -5,11 +5,21 @@
#include <fsfw/parameters/HasParametersIF.h> #include <fsfw/parameters/HasParametersIF.h>
#include <fsfw/parameters/ParameterHelper.h> #include <fsfw/parameters/ParameterHelper.h>
#include <fsfw/subsystem/Subsystem.h> #include <fsfw/subsystem/Subsystem.h>
#include <common/config/eive/eventSubsystemIds.h>
#include "mission/comDefs.h" #include "mission/comDefs.h"
class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF { class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
public: public:
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::COM_SUBSYSTEM;
//! [EXPORT] : [COMMENT] The transmit timer to protect the Syrlinks expired
//! P1: The current timer value
static const Event TX_TIMER_EXPIRED = MAKE_EVENT(1, severity::INFO);
//! [EXPORT] : [COMMENT] Transmitter will be turned on due to detection of bitlock
static const Event BIT_LOCK_TX_ON = MAKE_EVENT(2, severity::INFO);
/** /**
* @brief Constructor * @brief Constructor
* *
@ -17,8 +27,7 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
* @param maxNumberOfSequences * @param maxNumberOfSequences
* @param maxNumberOfTables * @param maxNumberOfTables
* @param transmitterTimeout Maximum time the transmitter of the syrlinks * @param transmitterTimeout Maximum time the transmitter of the syrlinks
* will * will be enabled
* be enabled
*/ */
ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables, ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables,
uint32_t transmitterTimeout); uint32_t transmitterTimeout);