Thermal Controller Update #399

Merged
muellerr merged 84 commits from thermal_controller into develop 2023-04-03 15:12:49 +02:00
346 changed files with 4088 additions and 5568 deletions
Showing only changes of commit 56a4378a63 - Show all commits

View File

@@ -24,6 +24,11 @@ ComSubsystem::ComSubsystem(object_id_t setObjectId, uint32_t maxNumberOfSequence
void ComSubsystem::performChildOperation() { void ComSubsystem::performChildOperation() {
readEventQueue(); readEventQueue();
if (performRecoveryToRxOnly and not isInTransition) {
startRxOnlyRecovery(true);
// To avoid immediately enabling TX after falling back.
rememberBitLock = false;
}
// Execute default rate sequence after transition has been completed // Execute default rate sequence after transition has been completed
if (rememberBitLock and not isInTransition) { if (rememberBitLock and not isInTransition) {
startRxAndTxLowRateSeq(); startRxAndTxLowRateSeq();
@@ -151,10 +156,16 @@ void ComSubsystem::handleEventMessage(EventMessage *eventMessage) {
Event event = eventMessage->getEvent(); Event event = eventMessage->getEvent();
switch (event) { switch (event) {
case tcsCtrl::SYRLINKS_OVERHEATING: { case tcsCtrl::SYRLINKS_OVERHEATING: {
// TODO: To prevent simply overwriting/cancelling on-going transitions, set flag here and // This event overrides the bit lock.
// execute transition at a later stage. rememberBitLock = false;
modeHelper.setForced(true); if (mode == com::RX_ONLY) {
startTransition(com::RX_ONLY, 0); return;
}
if (isInTransition) {
performRecoveryToRxOnly = true;
return;
}
startRxOnlyRecovery(true);
break; break;
} }
case PdecHandler::BIT_LOCK_PDEC: { case PdecHandler::BIT_LOCK_PDEC: {
@@ -204,6 +215,12 @@ void ComSubsystem::checkTransmitterCountdown() {
} }
} }
void ComSubsystem::startRxOnlyRecovery(bool forced) {
modeHelper.setForced(forced);
startTransition(com::RX_ONLY, 0);
performRecoveryToRxOnly = false;
}
bool ComSubsystem::isTxMode(Mode_t mode) { bool ComSubsystem::isTxMode(Mode_t mode) {
if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) || if ((mode == com::Submode::RX_AND_TX_DEFAULT_DATARATE) ||
(mode == com::Submode::RX_AND_TX_LOW_DATARATE) || (mode == com::Submode::RX_AND_TX_LOW_DATARATE) ||

View File

@@ -57,6 +57,7 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
* @brief Enables transmitter in low rate mode * @brief Enables transmitter in low rate mode
*/ */
void startRxAndTxLowRateSeq(); void startRxAndTxLowRateSeq();
void startRxOnlyRecovery(bool forced);
/** /**
* @brief Returns true if mode is a mode where the transmitter is on * @brief Returns true if mode is a mode where the transmitter is on
@@ -73,6 +74,7 @@ class ComSubsystem : public Subsystem, public ReceivesParameterMessagesIF {
MessageQueueIF *eventQueue = nullptr; MessageQueueIF *eventQueue = nullptr;
bool enableTxWhenCarrierLock = false; bool enableTxWhenCarrierLock = false;
bool performRecoveryToRxOnly = false;
// Countdown will be started as soon as the transmitter was enabled // Countdown will be started as soon as the transmitter was enabled
Countdown transmitterCountdown; Countdown transmitterCountdown;