From bdf397a71eeae26553bef3735969f39c42764d39 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Wed, 1 Feb 2023 08:27:55 +0100 Subject: [PATCH] corrections for transmitter timer in ccsds handler --- mission/tmtc/CcsdsIpCoreHandler.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mission/tmtc/CcsdsIpCoreHandler.cpp b/mission/tmtc/CcsdsIpCoreHandler.cpp index f31aeaa4..85d1143b 100644 --- a/mission/tmtc/CcsdsIpCoreHandler.cpp +++ b/mission/tmtc/CcsdsIpCoreHandler.cpp @@ -135,10 +135,12 @@ ReturnValue_t CcsdsIpCoreHandler::initialize() { return ObjectManagerIF::CHILD_INIT_FAILED; } + transmitterCountdown.setTimeout(transmitterTimeout); + transmitterCountdown.timeOut(); + #if OBSW_SYRLINKS_SIMULATED == 1 // Update data on rising edge ptmeConfig->invertTxClock(false); - transmitterCountdown.setTimeout(transmitterTimeout); linkState = UP; forwardLinkstate(); #endif /* OBSW_SYRLINKS_SIMULATED == 1*/ @@ -348,6 +350,9 @@ void CcsdsIpCoreHandler::enableTransmit() { gpioIF->pullHigh(enTxClock); gpioIF->pullHigh(enTxData); #endif + linkState = UP; + forwardLinkstate(); + transmitterCountdown.resetTimer(); } void CcsdsIpCoreHandler::checkTxTimer() { @@ -356,6 +361,7 @@ void CcsdsIpCoreHandler::checkTxTimer() { } if (transmitterCountdown.hasTimedOut()) { disableTransmit(); + //TODO: set mode to off (move timer to subsystem) } } @@ -425,7 +431,7 @@ void CcsdsIpCoreHandler::disableTransmit() { #endif linkState = DOWN; forwardLinkstate(); - transmitterCountdown.setTimeout(0); + transmitterCountdown.timeOut(); } const char* CcsdsIpCoreHandler::getName() const { return "CCSDS Handler"; }