add settings

This commit is contained in:
Terrence
2024-11-15 04:44:53 +08:00
parent ec918748f1
commit 58de3852c5
15 changed files with 237 additions and 89 deletions

View File

@@ -18,6 +18,7 @@ extern "C" void app_main(void)
// Initialize NVS flash for WiFi configuration
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_LOGW(TAG, "Erasing NVS flash to fix corruption");
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}