Solaris Software
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
3#include "custom.h"
4
5void app_main(void)
6
7{
8 //Get HAL port
10
11 // HAL init
12 SPP_RetVal_t ret = SPP_HAL_init((void *)p_halPorts);
13 if (ret != K_SPP_OK)
14 {
15 while (1)
16 {
17 // Infinite loop
18 }
19 }
20
21 // Get the custom FSM
22 const FSM_Transition_t *p_fsmTable = CUSTOM_getFsmTable();
23
24 // FSM init
25 ret = FSM_init(p_fsmTable, K_CUSTOM_FSM_TABLE_SIZE);
26 if (ret != K_SPP_OK)
27 {
28 while (1)
29 {
30 // Infinite loop
31 }
32 }
33
34 // Call the Herarchical Finite State Machine
35 while (1)
36 {
37 FSM_tick();
38 }
39}
const FSM_Transition_t * CUSTOM_getFsmTable(void)
Definition custom.c:66
Finite State Machine (FSM) module for the SPP core.
#define K_CUSTOM_FSM_TABLE_SIZE
Definition custom.h:17
SPP_RetVal_t FSM_init(const FSM_Transition_t *p_transitionTable, const spp_uint8_t tableSize)
Initialize the FSM.
Definition fsm.c:38
void FSM_tick(void)
Evaluate the transition table and advance the FSM if a guard passes. Call this once per superloop tic...
Definition fsm.c:58
Finite State Machine (FSM) module for the SPP core.
const SPP_HalPort_t * SPP_PORTS_ESP32S3_getHalPorts(void)
Returns a pointer to the ESP32-S3 HAL port descriptor.
Definition halEsp32.c:105
ESP32-S3 HAL port descriptor for SPP.
SPP_RetVal_t SPP_HAL_init(void *p_halPorts)
This functions initializes the ports struct and initializes all the peripherals.
Definition hal.c:26
void app_main(void)
Definition main.c:5
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition returnTypes.h:24
@ K_SPP_OK
Definition returnTypes.h:25
A single row in the FSM transition table.
Definition fsm.h:49
Ports struct that contains all the pointers to the Ports functions.
Definition hal.h:215