I2C reboot procedure for EIVE system
Some checks failed
EIVE/eive-obsw/pipeline/head Build started...
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit

This commit is contained in:
2023-04-06 16:50:33 +02:00
parent d8ec121131
commit 3bd434bbc3
17 changed files with 267 additions and 154 deletions

View File

@ -0,0 +1,46 @@
#ifndef MISSION_SYSTEM_EIVESYSTEM_H_
#define MISSION_SYSTEM_EIVESYSTEM_H_
#include <fsfw/action/HasActionsIF.h>
#include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/subsystem/Subsystem.h>
class EiveSystem : public Subsystem, public HasActionsIF {
public:
static constexpr ActionId_t EXECUTE_I2C_REBOOT = 10;
EiveSystem(object_id_t setObjectId, uint32_t maxNumberOfSequences, uint32_t maxNumberOfTables);
void setPowerSwitcher(PowerSwitchIF* pwrSwitcher);
[[nodiscard]] MessageQueueId_t getCommandQueue() const override;
private:
enum class I2cRebootState {
NONE,
SYSTEM_MODE_BOOT,
SWITCH_3V3_STACK_OFF_AND_BATT_REBOOT,
SWITCH_3V3_STACK_ON,
SYSTEM_MODE_SAFE
} i2cRebootState = I2cRebootState::NONE;
MessageQueueIF* eventQueue = nullptr;
bool performSafeRecovery = false;
bool performI2cReboot = false;
ActionHelper actionHelper;
PowerSwitchIF* powerSwitcher = nullptr;
MessageQueueId_t bpxBattQueueId = MessageQueueIF::NO_QUEUE;
MessageQueueId_t actionCommandedBy = MessageQueueIF::NO_QUEUE;
Countdown i2cRebootCountdown = Countdown(10000);
ReturnValue_t initialize() override;
void performChildOperation() override;
void announceMode(bool recursive) override;
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) override;
void handleEventMessages();
void commandSelfToSafe();
};
#endif /* MISSION_SYSTEM_EIVESYSTEM_H_ */