Skip to content

Commit

Permalink
Updated transitions
Browse files Browse the repository at this point in the history
  • Loading branch information
krichardsson committed May 15, 2023
1 parent 5f35cff commit 183fe51
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/modules/src/supervisor_state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ static SupervisorStateTransition_t transitionsPreFlChecksNotPassed[] = {
.triggerCombiner = supervisorAlways,

.blockers = SUPERVISOR_CB_CHARGER_CONNECTED | SUPERVISOR_CB_IS_TUMBLED | SUPERVISOR_CB_EMERGENCY_STOP,
.negatedBlockers = SUPERVISOR_CB_NONE,
.blockerCombiner = supervisorAny,
}
};
Expand Down Expand Up @@ -85,19 +86,10 @@ static SupervisorStateTransition_t transitionsPreFlChecksPassed[] = {
};

static SupervisorStateTransition_t transitionsReadyToFly[] = {
{
.newState = supervisorStateExceptFreeFall,

.triggers = SUPERVISOR_CB_EMERGENCY_STOP,
.negatedTriggers = SUPERVISOR_CB_NONE,
.triggerCombiner = supervisorAll,

.blockerCombiner = supervisorNever,
},
{
.newState = supervisorStatePreFlChecksNotPassed,

.triggers = SUPERVISOR_CB_IS_TUMBLED | SUPERVISOR_CB_CHARGER_CONNECTED,
.triggers = SUPERVISOR_CB_IS_TUMBLED | SUPERVISOR_CB_CHARGER_CONNECTED | SUPERVISOR_CB_EMERGENCY_STOP,
.negatedTriggers = SUPERVISOR_CB_ARMED,
.triggerCombiner = supervisorAny,

Expand Down Expand Up @@ -136,11 +128,11 @@ static SupervisorStateTransition_t transitionsFlying[] = {
{
.newState = supervisorStateLanded,

.triggerCombiner = supervisorAlways,
.triggers = SUPERVISOR_CB_NONE,
.negatedTriggers = SUPERVISOR_CB_IS_FLYING,
.triggerCombiner = supervisorAll,

.blockers = SUPERVISOR_CB_IS_FLYING,
.negatedBlockers = SUPERVISOR_CB_NONE,
.blockerCombiner = supervisorAny,
.blockerCombiner = supervisorNever,
}
};

Expand Down Expand Up @@ -168,8 +160,8 @@ static SupervisorStateTransition_t transitionsWarningLevelOut[] = {
{
.newState = supervisorStateExceptFreeFall,

.triggers = SUPERVISOR_CB_COMMANDER_WDT_TIMEOUT | SUPERVISOR_CB_IS_TUMBLED,
.negatedTriggers = SUPERVISOR_CB_NONE,
.triggers = SUPERVISOR_CB_COMMANDER_WDT_TIMEOUT | SUPERVISOR_CB_IS_TUMBLED | SUPERVISOR_CB_EMERGENCY_STOP,
.negatedTriggers = SUPERVISOR_CB_ARMED,
.triggerCombiner = supervisorAny,

.blockerCombiner = supervisorNever,
Expand Down

0 comments on commit 183fe51

Please sign in to comment.