From 183fe51567a90ba4aaefb74383041611ae3a6afd Mon Sep 17 00:00:00 2001 From: Kristoffer Richardsson Date: Mon, 15 May 2023 14:34:39 +0200 Subject: [PATCH] Updated transitions --- src/modules/src/supervisor_state_machine.c | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/modules/src/supervisor_state_machine.c b/src/modules/src/supervisor_state_machine.c index fb20ed4c61..d1a3cf9bb3 100644 --- a/src/modules/src/supervisor_state_machine.c +++ b/src/modules/src/supervisor_state_machine.c @@ -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, } }; @@ -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, @@ -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, } }; @@ -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,