diff --git a/mission/system/EiveSystem.cpp b/mission/system/EiveSystem.cpp index 8f0d6783..a202b8d6 100644 --- a/mission/system/EiveSystem.cpp +++ b/mission/system/EiveSystem.cpp @@ -200,11 +200,14 @@ void EiveSystem::i2cRecoveryLogic() { TaskFactory::delayTask(500); // We already tried an I2C recovery but the bus is still broken. // Send reboot request to core controller. - ReturnValue_t result = sendSelfRebootCommand(); - if(result != returnvalue::OK) { + result = sendSelfRebootCommand(); + 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. + return; } - // If the previous operation failed, it should be re-attempted the next task cycle. + // Wait for reboot to be done. + TaskFactory::delayTask(3000); return; } } @@ -304,11 +307,14 @@ void EiveSystem::pdecRecoveryLogic() { TaskFactory::delayTask(500); // Send reboot command. ReturnValue_t result = sendSelfRebootCommand(); - if(result != returnvalue::OK) { + 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(); } + // We are done / about to reboot. Delay the rest of the time, graceful reboot takes some + // time. + TaskFactory::delayTask(3000); return; } else { // Try one full PDEC reset.