-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
42 lines (35 loc) · 1.15 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/***************************************************************************//**
* @file main.c
* @brief Contains the {@link main()} function of this system.
* @author Georgios Apostolakis
******************************************************************************/
#include "sl_system_init.h"
#include "sl_power_manager.h"
#include "sl_system_process_action.h"
#include "app/app_init.h"
#include "app/app_process.h"
///A static handle of a RAIL instance
static RAIL_Handle_t rail_handle;
/**
* The first function to be called when the system is being
* executed.
*
* @date 01/02/2023
* @return It never returns, as it enters an infinite loop which runs while the
* board is active.
*/
int main(void) {
// Initialize Silicon Labs device, system, service(s) and protocol stack(s).
sl_system_init();
// Initialize the application.
rail_handle = app_init();
while (1) {
// Do not remove this call: Silicon Labs components process action
// routine, which must be called here.
sl_system_process_action();
// Application process.
app_process_action(rail_handle);
// Let the CPU go to sleep if the system allows it.
sl_power_manager_sleep();
}
}