State machine initialization

Asset Tracker Template

tags
Asset Tracker Template

State machines are initialized to an initial state using smf_set_initial():

smf_set_initial(SMF_CTX(&module_state), &states[STATE_RUNNING]);

This has to be done before the state machine is executed for the first time.