Finite State Machine (FSM) implementation for the SPP core. More...
Go to the source code of this file.
Data Structures | |
| struct | FSM_Table_t |
Functions | |
| static void | FSM_pubsubCycle (void) |
| Run one complete PUBSUB cycle: acquire producer data and dispatch it to the consumer mailboxes, then call consumeData(). | |
| spp_uint16_t * | SPP_CORE_FSM_getErrorsBit (void) |
| Get the pointer to the FSM errors bit. | |
| SPP_RetVal_t | FSM_init (void) |
| Initialise the FSM with the internal service table. The service table runs the PUBSUB produce/consume cycle in the active states. Use FSM_addTable to append application rows. | |
| SPP_RetVal_t | FSM_addTable (const FSM_Transition_t *p_transitionTable, const spp_uint8_t tableSize) |
| Append a transition table to 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 FSM_Table_t | s_tables [K_FSM_MAX_TABLES] |
| static spp_uint8_t | s_tableCount = 0U |
| static FSM_Handle_t | s_fsmHandle |
| static const FSM_Transition_t | s_fsmBaseTable [] |
Finite State Machine (FSM) implementation for the SPP core.
Definition in file fsm.c.
|
static |
Run one complete PUBSUB cycle: acquire producer data and dispatch it to the consumer mailboxes, then call consumeData().
Definition at line 44 of file fsm.c.
References FSM_pubsubCycle(), SPP_SERVICES_PUBSUB_callConsumers(), and SPP_SERVICES_PUBSUB_callProducers().
Referenced by FSM_pubsubCycle().
| spp_uint16_t * SPP_CORE_FSM_getErrorsBit | ( | void | ) |
Get the pointer to the FSM errors bit.
Definition at line 117 of file fsm.c.
References s_fsmErrors, and SPP_CORE_FSM_getErrorsBit().
Referenced by SPP_CORE_FSM_getErrorsBit(), and SPP_SERVICES_M10M_init().
| SPP_RetVal_t FSM_init | ( | void | ) |
Initialise the FSM with the internal service table. The service table runs the PUBSUB produce/consume cycle in the active states. Use FSM_addTable to append application rows.
Definition at line 122 of file fsm.c.
References FSM_addTable(), FSM_init(), FSM_STATE_INIT, FSM_SUBSTATE_NONE, FSM_Handle_t::prevState, FSM_Handle_t::prevSubState, s_fsmBaseTable, s_fsmHandle, s_tableCount, FSM_Handle_t::state, and FSM_Handle_t::subState.
Referenced by APP_initFsm(), and FSM_init().
| SPP_RetVal_t FSM_addTable | ( | const FSM_Transition_t * | p_transitionTable, |
| const spp_uint8_t | tableSize ) |
Append a transition table to the FSM.
| p_transitionTable | Pointer to the table to append. |
| tableSize | Number of rows in the table. |
Definition at line 135 of file fsm.c.
References FSM_addTable(), K_FSM_MAX_TABLE_SIZE, K_FSM_MAX_TABLES, K_SPP_ERROR_INVALID_PARAMETER, K_SPP_ERROR_NULL_POINTER, K_SPP_ERROR_REGISTRY_FULL, K_SPP_OK, FSM_Table_t::p_table, s_tableCount, s_tables, and FSM_Table_t::size.
Referenced by APP_initFsm(), FSM_addTable(), 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 159 of file fsm.c.
References FSM_Transition_t::action, FSM_Transition_t::fromState, FSM_Transition_t::fromSubState, FSM_tick(), FSM_Transition_t::guard, FSM_Table_t::p_table, FSM_Handle_t::prevState, FSM_Handle_t::prevSubState, s_fsmHandle, s_tableCount, s_tables, FSM_Table_t::size, FSM_Handle_t::state, FSM_Transition_t::stateFunction, FSM_Handle_t::subState, FSM_Transition_t::toState, and FSM_Transition_t::toSubState.
Referenced by APP_fsmLoop(), and FSM_tick().
|
static |
|
static |
Definition at line 27 of file fsm.c.
Referenced by FSM_addTable(), and FSM_tick().
|
static |
Definition at line 28 of file fsm.c.
Referenced by FSM_addTable(), FSM_init(), and FSM_tick().
|
static |
Definition at line 30 of file fsm.c.
Referenced by FSM_init(), and FSM_tick().
|
static |
Definition at line 57 of file fsm.c.
Referenced by FSM_init().