Solaris Software
Toggle main menu visibility
Loading...
Searching...
No Matches
main.c
Go to the documentation of this file.
1
#include "
spp/services/fsm/fsm.h
"
2
#include "
spp/ports/hal/esp32/halEsp32.h
"
3
#include "
custom.h
"
4
5
void
app_main
(
void
)
6
7
{
8
//Get HAL port
9
const
SPP_HalPort_t
*p_halPorts =
SPP_PORTS_ESP32S3_getHalPorts
();
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
}
CUSTOM_getFsmTable
const FSM_Transition_t * CUSTOM_getFsmTable(void)
Definition
custom.c:66
custom.h
Finite State Machine (FSM) module for the SPP core.
K_CUSTOM_FSM_TABLE_SIZE
#define K_CUSTOM_FSM_TABLE_SIZE
Definition
custom.h:17
FSM_init
SPP_RetVal_t FSM_init(const FSM_Transition_t *p_transitionTable, const spp_uint8_t tableSize)
Initialize the FSM.
Definition
fsm.c:38
FSM_tick
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
fsm.h
Finite State Machine (FSM) module for the SPP core.
SPP_PORTS_ESP32S3_getHalPorts
const SPP_HalPort_t * SPP_PORTS_ESP32S3_getHalPorts(void)
Returns a pointer to the ESP32-S3 HAL port descriptor.
Definition
halEsp32.c:105
halEsp32.h
ESP32-S3 HAL port descriptor for SPP.
SPP_HAL_init
SPP_RetVal_t SPP_HAL_init(void *p_halPorts)
This functions initializes the ports struct and initializes all the peripherals.
Definition
hal.c:26
app_main
void app_main(void)
Definition
main.c:5
SPP_RetVal_t
SPP_RetVal_t
Unified return type for all SPP API functions.
Definition
returnTypes.h:24
K_SPP_OK
@ K_SPP_OK
Definition
returnTypes.h:25
FSM_Transition_t
A single row in the FSM transition table.
Definition
fsm.h:49
SPP_HalPort_t
Ports struct that contains all the pointers to the Ports functions.
Definition
hal.h:215
solaris-v2
main
main.c
Generated by
1.18.0