initial commit

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2024-05-06 22:08:25 +02:00
commit 97c559d8a0
8 changed files with 975 additions and 0 deletions

2
main/CMakeLists.txt Normal file
View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "main.c"
INCLUDE_DIRS ".")

34
main/main.c Normal file
View File

@@ -0,0 +1,34 @@
#include <stdio.h>
#include <esp_task_wdt.h>
#include <nvs.h>
#include <nvs_flash.h>
void nvs_init()
{
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND)
{
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
}
void setup()
{
nvs_init();
}
void loop()
{
ESP_ERROR_CHECK(esp_task_wdt_reset());
}
void app_main()
{
setup();
while (1)
{
loop();
}
}