trigger special reboot events

This commit is contained in:
Robin Müller 2023-04-14 20:04:51 +02:00
parent 7f1fe3a2d8
commit aa800c4524
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 5 additions and 1 deletions

View File

@ -93,6 +93,8 @@ static constexpr Event INDIVIDUAL_BOOT_COUNTS = event::makeEvent(SUBSYSTEM_ID, 8
static constexpr Event TRYING_I2C_RECOVERY = event::makeEvent(SUBSYSTEM_ID, 10, severity::MEDIUM); static constexpr Event TRYING_I2C_RECOVERY = event::makeEvent(SUBSYSTEM_ID, 10, severity::MEDIUM);
//! [EXPORT] : [COMMENT] I2C is unavailable. Recovery did not work, performing full reboot. //! [EXPORT] : [COMMENT] I2C is unavailable. Recovery did not work, performing full reboot.
static constexpr Event I2C_REBOOT = event::makeEvent(SUBSYSTEM_ID, 11, severity::MEDIUM); static constexpr Event I2C_REBOOT = event::makeEvent(SUBSYSTEM_ID, 11, severity::MEDIUM);
//! [EXPORT] : [COMMENT] PDEC recovery through reset was not possible, performing full reboot.
static constexpr Event PDEC_REBOOT = event::makeEvent(SUBSYSTEM_ID, 12, severity::MEDIUM);
} // namespace core } // namespace core

View File

@ -4,6 +4,7 @@
#include <fsfw/events/EventManager.h> #include <fsfw/events/EventManager.h>
#include <fsfw/ipc/QueueFactory.h> #include <fsfw/ipc/QueueFactory.h>
#include <fsfw/power/PowerSwitchIF.h> #include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/tasks/TaskFactory.h>
#include <mission/acs/defs.h> #include <mission/acs/defs.h>
#include <mission/com/defs.h> #include <mission/com/defs.h>
#include <mission/controller/tcsDefs.h> #include <mission/controller/tcsDefs.h>
@ -64,7 +65,6 @@ void EiveSystem::performChildOperation() {
return; return;
} }
pdecRecoveryLogic(); pdecRecoveryLogic();
i2cRecoveryLogic(); i2cRecoveryLogic();
} }
@ -189,6 +189,7 @@ void EiveSystem::i2cRecoveryLogic() {
// Try recovery. // Try recovery.
executeAction(EXECUTE_I2C_REBOOT, MessageQueueIF::NO_QUEUE, nullptr, 0); executeAction(EXECUTE_I2C_REBOOT, MessageQueueIF::NO_QUEUE, nullptr, 0);
} else { } else {
triggerEvent(core::I2C_REBOOT);
// We already tried an I2C recovery but the bus is still broken. // We already tried an I2C recovery but the bus is still broken.
// Send full reboot request to core controller. // Send full reboot request to core controller.
sendFullRebootCommand(); sendFullRebootCommand();
@ -286,6 +287,7 @@ void EiveSystem::pdecRecoveryLogic() {
// If a PTME reset was already attempted and there is still an issue receiving TC frames, // If a PTME reset was already attempted and there is still an issue receiving TC frames,
// reboot the system. // reboot the system.
if (ptmeResetWasAttempted) { if (ptmeResetWasAttempted) {
triggerEvent(core::PDEC_REBOOT);
// Send reboot command. // Send reboot command.
sendFullRebootCommand(); sendFullRebootCommand();
} else { } else {