diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index ed1e76a5..41f52cde 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -296,14 +296,14 @@ ReturnValue_t EiveSystem::sendFullRebootCommand() { } void EiveSystem::pdecRecoveryLogic() { - if (ptmeResetWasAttempted and ptmeResetWasAttemptedCd.hasTimedOut()) { - ptmeResetWasAttempted = false; + if (pdecResetWasAttempted and pdecResetWasAttemptedCd.hasTimedOut()) { + pdecResetWasAttempted = false; } if (frameDirtyCheckCd.hasTimedOut()) { if (frameDirtyErrorCounter >= FRAME_DIRTY_COM_REBOOT_LIMIT) { // If a PTME reset was already attempted and there is still an issue receiving TC frames, // reboot the system. - if (ptmeResetWasAttempted) { + if (pdecResetWasAttempted) { if (waitingForPdecReboot) { return; } @@ -315,7 +315,8 @@ void EiveSystem::pdecRecoveryLogic() { if (result != returnvalue::OK) { sif::error << "Sending a reboot command has failed" << std::endl; // If the previous operation failed, it should be re-attempted the next task cycle. - ptmeResetWasAttemptedCd.resetTimer(); + pdecResetWasAttemptedCd.resetTimer(); + return; } waitingForPdecReboot = true; return; @@ -325,8 +326,8 @@ void EiveSystem::pdecRecoveryLogic() { store_address_t dummy{}; ActionMessage::setCommand(&msg, pdec::RESET_PDEC_WITH_REINIITALIZATION, dummy); commandQueue->sendMessage(pdecHandlerQueueId, &msg); - ptmeResetWasAttemptedCd.resetTimer(); - ptmeResetWasAttempted = true; + pdecResetWasAttemptedCd.resetTimer(); + pdecResetWasAttempted = true; } } frameDirtyErrorCounter = 0; diff --git a/mission/system/EiveSystem.h b/mission/system/EiveSystem.h index 486b13c5..c724ba34 100644 --- a/mission/system/EiveSystem.h +++ b/mission/system/EiveSystem.h @@ -39,8 +39,8 @@ class EiveSystem : public Subsystem, public HasActionsIF { Countdown frameDirtyCheckCd = Countdown(10000); // If the PDEC reset was already attempted in the last 2 minutes, there is a high chance that // only a full reboot will fix the issue. - Countdown ptmeResetWasAttemptedCd = Countdown(120000); - bool ptmeResetWasAttempted = false; + Countdown pdecResetWasAttemptedCd = Countdown(120000); + bool pdecResetWasAttempted = false; bool waitingForI2cReboot = false; bool waitingForPdecReboot = false;