From 8482416ac517e32b127cc5ec7b11814b11e1a95c Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 7 Apr 2023 17:24:19 +0200 Subject: [PATCH] this is necessary so it works.. --- mission/system/EiveSystem.cpp | 9 +++------ mission/system/EiveSystem.h | 1 - 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 8eced106..f93aa099 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -144,9 +144,6 @@ ReturnValue_t EiveSystem::executeAction(ActionId_t actionId, MessageQueueId_t co case (EXECUTE_I2C_REBOOT): { triggerEvent(core::TRYING_I2C_RECOVERY); performI2cReboot = true; - // This flag is more related to autonomous recovery handling, so we reset it here if this - // reboot sequence is commanded manually. - alreadyTriedI2cRecovery = false; i2cRebootState = I2cRebootState::SYSTEM_MODE_BOOT; this->actionCommandedBy = commandedBy; return returnvalue::OK; @@ -264,11 +261,11 @@ void EiveSystem::commandSelfToSafe() { startTransition(satsystem::Mode::SAFE, 0) void EiveSystem::commonI2cRecoverySequenceFinish() { alreadyTriedI2cRecovery = true; performI2cReboot = false; - i2cRecoveryClearCountdown.resetTimer(); i2cRebootState = I2cRebootState::NONE; - // Reset this counter. If I2C devices are still problematic, we will get a full reboot - // next time this count goes above 5. + // Reset this counter and the recovery clear countdown. If I2C devices are still problematic, + // we will get a full reboot next time this count goes above 5. i2cErrors = 0; + i2cRecoveryClearCountdown.resetTimer(); // This should always be accepted commandSelfToSafe(); } diff --git a/mission/system/EiveSystem.h b/mission/system/EiveSystem.h index fd1d540c..504d4317 100644 --- a/mission/system/EiveSystem.h +++ b/mission/system/EiveSystem.h @@ -41,7 +41,6 @@ class EiveSystem : public Subsystem, public HasActionsIF { MessageQueueId_t coreCtrlQueueId = MessageQueueIF::NO_QUEUE; MessageQueueId_t actionCommandedBy = MessageQueueIF::NO_QUEUE; Countdown i2cRebootHandlingCountdown = Countdown(10000); - // Countdown i2cUnavailableCountdown = Countdown(30000); // After 1 minute, clear the flag to avoid full reboots on I2C issues. Countdown i2cRecoveryClearCountdown = Countdown(60000); ReturnValue_t initialize() override;