Browse Source

Commander: State machine helper documentation

Future contributors need to know about the time constraints that the execution of this function needs to satisfy.
sbg
Lorenz Meier 7 years ago
parent
commit
4abc578932
  1. 5
      src/modules/commander/state_machine_helper.cpp

5
src/modules/commander/state_machine_helper.cpp

@ -377,6 +377,11 @@ transition_result_t @@ -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 */

Loading…
Cancel
Save