From 4abc57893274800a16c7988d417e9e16e3f4b179 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Thu, 30 Nov 2017 12:08:25 +0000 Subject: [PATCH] Commander: State machine helper documentation Future contributors need to know about the time constraints that the execution of this function needs to satisfy. --- src/modules/commander/state_machine_helper.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/commander/state_machine_helper.cpp b/src/modules/commander/state_machine_helper.cpp index 5fe988f867..c7d902ba34 100644 --- a/src/modules/commander/state_machine_helper.cpp +++ b/src/modules/commander/state_machine_helper.cpp @@ -377,6 +377,11 @@ transition_result_t main_state_transition(struct vehicle_status_s *status, main_state_t new_main_state, uint8_t &main_state_prev, status_flags_s *status_flags, struct commander_state_s *internal_state) { + // IMPORTANT: The assumption of callers of this function is that the execution of + // this check if essentially "free". Therefore any runtime checking in here has to be + // kept super lightweight. No complex logic or calls on external function should be + // implemented here. + transition_result_t ret = TRANSITION_DENIED; /* transition may be denied even if the same state is requested because conditions may have changed */