Finite State Machine (FSM) implementation for the SPP core. More...
#include "spp/services/fsm/fsm.h"Go to the source code of this file.
Functions | |
| spp_uint16_t * | SPP_CORE_FSM_getErrorsBit (void) |
| Get the pointer to the FSM errors bit. | |
| SPP_RetVal_t | FSM_init (const FSM_Transition_t *p_transitionTable, const spp_uint8_t tableSize) |
| Initialize the FSM. | |
| void | FSM_tick (void) |
| Evaluate the transition table and advance the FSM if a guard passes. Call this once per superloop tick. | |
Variables | |
| static spp_uint16_t | s_fsmErrors = {0} |
| static const FSM_Transition_t * | p_s_transitionTable = NULL |
| static FSM_Handle_t | s_fsmHandle |
| static spp_uint8_t | s_tableSize = 0 |
Finite State Machine (FSM) implementation for the SPP core.
Definition in file fsm.c.
| spp_uint16_t * SPP_CORE_FSM_getErrorsBit | ( | void | ) |
Get the pointer to the FSM errors bit.
Definition at line 33 of file fsm.c.
References s_fsmErrors, and SPP_CORE_FSM_getErrorsBit().
Referenced by SPP_CORE_FSM_getErrorsBit(), SPP_SERVICES_DATALOGGER_init(), SPP_SERVICES_ICM20948_init(), and SPP_SERVICES_M10M_init().
| SPP_RetVal_t FSM_init | ( | const FSM_Transition_t * | p_transitionTable, |
| const spp_uint8_t | tableSize ) |
Initialize the FSM.
| p_halPorts | Pointer to the HAL ports. |
| p_transitiontable | Pointer to the FSM table for operation. |
| tableSize | Size of the table. |
Definition at line 38 of file fsm.c.
References FSM_init(), K_FSM_MAX_TABLE_SIZE, K_SPP_ERROR_INVALID_PARAMETER, K_SPP_ERROR_NULL_POINTER, K_SPP_OK, p_s_transitionTable, and s_tableSize.
Referenced by app_main(), and FSM_init().
| void FSM_tick | ( | void | ) |
Evaluate the transition table and advance the FSM if a guard passes. Call this once per superloop tick.
Definition at line 58 of file fsm.c.
References FSM_Transition_t::action, FSM_Transition_t::fromState, FSM_Transition_t::fromSubState, FSM_tick(), FSM_Transition_t::guard, p_s_transitionTable, FSM_Handle_t::prevState, FSM_Handle_t::prevSubState, s_fsmHandle, s_tableSize, FSM_Handle_t::state, FSM_Transition_t::stateFunction, FSM_Handle_t::subState, FSM_Transition_t::toState, and FSM_Transition_t::toSubState.
Referenced by app_main(), and FSM_tick().
|
static |
|
static |
Definition at line 18 of file fsm.c.
Referenced by FSM_init(), and FSM_tick().
|
static |
Definition at line 20 of file fsm.c.
Referenced by FSM_tick().
|
static |
Definition at line 27 of file fsm.c.
Referenced by FSM_init(), and FSM_tick().