Fix wifi crashing because stack overflow and fix esp_ota cancelling when starting from factory

This commit is contained in:
2026-03-07 22:49:41 -05:00
parent e661e15bbf
commit 3fa879d007
2 changed files with 40 additions and 39 deletions

View File

@@ -168,8 +168,16 @@ extern "C" void app_main()
printf("Connected!\n");
// Mark the current app as valid to cancel rollback
esp_ota_mark_app_valid_cancel_rollback();
// Mark the current app as valid to cancel rollback, only if it's an OTA app
{
const esp_partition_t *running = esp_ota_get_running_partition();
if (running != NULL &&
running->subtype >= ESP_PARTITION_SUBTYPE_APP_OTA_MIN &&
running->subtype < ESP_PARTITION_SUBTYPE_APP_OTA_MAX)
{
esp_ota_mark_app_valid_cancel_rollback();
}
}
// Start the webserver
web_server = start_webserver();