Midnight Sun Firmware
Loading...
Searching...
No Matches
Finite_State_Machine

FSM library. More...

Classes

struct  State
 
struct  Fsm
 

Macros

#define MAX_STATES   10
 
#define MAX_TRANSITIONS   5
 
#define STATE(state_id, entry, state_func)   [state_id] = { .entry_func = entry, .state_action = state_func }
 Creates state with associated ID in a state list. More...
 

Typedefs

typedef void(* StateAction) (void *context)
 
typedef uint8_t StateId
 

Detailed Description

FSM library.

Macro Definition Documentation

◆ STATE

#define STATE (   state_id,
  entry,
  state_func 
)    [state_id] = { .entry_func = entry, .state_action = state_func }

Creates state with associated ID in a state list.

State id must be unique (preferred to use enum type)