|
Modbus Vault v1.0
|
Implementation of the system orchestration layer. More...
#include "controller.h"#include "esp_err.h"#include "esp_timer.h"#include "metrics.h"#include "runtime_tasks.h"#include "slab_pool.h"#include "system_init.h"#include "telemetry_service.h"Macros | |
| #define | CONTROLLER_WAIT_ON_LOCK_TIME_US (100U) |
| #define | CONTROLLER_YIELD_TIME_US (1000000U) |
Functions | |
| static void | set_state_helper (controller_state_t new_state) |
| Set controller state. | |
| static esp_err_t | handle_init_helper (void) |
| Handles system initialization. | |
| static void | handle_deinit_helper (void) |
| Handles system deinitialization. | |
| void | controller_run (void) |
| Start controller. | |
| controller_state_t | controller_get_state (void) |
| Get current controller state. | |
| void | controller_request_stop (void) |
| Stop controller. | |
Variables | |
| static controller_state_t | current_state = CONTROLLER_STATE_UNINITIALIZED |
| static SemaphoreHandle_t | state_mutex = NULL |
Implementation of the system orchestration layer.
| #define CONTROLLER_WAIT_ON_LOCK_TIME_US (100U) |
State lock wait timeout in micro seconds
| #define CONTROLLER_YIELD_TIME_US (1000000U) |
Yield time of control loop in micro seconds
| controller_state_t controller_get_state | ( | void | ) |
Get current controller state.
< State lock wait timeout in micro seconds
| void controller_request_stop | ( | void | ) |
Stop controller.
Request deinitialize and stopping of different system components
| void controller_run | ( | void | ) |
Start controller.
Initialize, setup and start different system components
< Yield time of control loop in micro seconds
|
static |
Handles system deinitialization.
|
static |
Handles system initialization.
| ESP_OK | Handle success |
| any | Any error from down layers propagates upward |
|
static |
Set controller state.
| new_state | Controller state |
< State lock wait timeout in micro seconds
|
static |
Current controller state
|
static |
State lock handle