WIP: System Events
This commit is contained in:
parent
1c2f281579
commit
c979c38fd7
46 changed files with 647 additions and 470 deletions
16
main/main.c
16
main/main.c
|
|
@ -41,6 +41,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include <SystemK.h>
|
||||
#include <System_Events.h>
|
||||
#include <SPIFFS.h>
|
||||
#include <USB.h>
|
||||
#include <I2S_Audio.h>
|
||||
|
|
@ -62,6 +63,9 @@ void app_main(void)
|
|||
KLOG_INFO(TAG, VERSION_AS_STR());
|
||||
|
||||
KLOG_INFO(TAG, "Initializing app...");
|
||||
|
||||
Initialize_System_Events();
|
||||
|
||||
init_complete_semaphore = xSemaphoreCreateBinary();
|
||||
|
||||
// Initialize NVS — it is used by both the BLE and WiFi drivers.
|
||||
|
|
@ -71,7 +75,17 @@ void app_main(void)
|
|||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK(ret);
|
||||
|
||||
if (ret == ESP_OK)
|
||||
{
|
||||
xEventGroupSetBits(Get_System_Events(), SYS_NVS_READY);
|
||||
KLOG_INFO(TAG, "NVS initialized.");
|
||||
}
|
||||
else
|
||||
{
|
||||
KLOG_ERROR(TAG, "Error initializing NVS: %s", esp_err_to_name(ret));
|
||||
}
|
||||
|
||||
|
||||
Initialize_SPIFFS(init_complete_semaphore);
|
||||
if (xSemaphoreTake(init_complete_semaphore, pdMS_TO_TICKS(INITIALIZATION_TIMEOUT_IN_ms)) != pdTRUE)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue