From 478c954b31250e5cf2057598380c53fbdb588ef6 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Mon, 1 May 2023 10:10:14 +0100 Subject: [PATCH] #682 hfsm::start() does not update state for call_on_enter_state = true --- include/etl/hfsm.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/include/etl/hfsm.h b/include/etl/hfsm.h index b49eaa19..7f613296 100644 --- a/include/etl/hfsm.h +++ b/include/etl/hfsm.h @@ -65,16 +65,13 @@ namespace etl ETL_ASSERT(p_state != ETL_NULLPTR, ETL_ERROR(etl::fsm_null_state_exception)); if (call_on_enter_state) - { - do_enters(ETL_NULLPTR, p_state, true); + { + etl::fsm_state_id_t next_state = do_enters(ETL_NULLPTR, p_state, true); - - //etl::fsm_state_id_t next_state = do_enters(ETL_NULLPTR, p_state, true); - - //if (ifsm_state::No_State_Change != next_state) - //{ - // p_state = state_list[next_state]; - //} + if (next_state != ifsm_state::No_State_Change) + { + p_state = state_list[next_state]; + } } } }