Skip to content

Commit 3bf024f

Browse files
committed
rg_system: Delete boot config after panic or recovery
1 parent 8fab630 commit 3bf024f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

components/retro-go/rg_system.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,7 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg
477477

478478
if (app.bootFlags & RG_BOOT_ONCE)
479479
{
480-
rg_settings_set_string(NS_BOOT, SETTING_BOOT_NAME, "launcher");
481-
rg_settings_commit();
480+
rg_storage_delete(RG_BASE_PATH_CONFIG "/boot.json");
482481
#ifdef ESP_PLATFORM
483482
esp_ota_set_boot_partition(esp_partition_find_first(
484483
ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, RG_APP_LAUNCHER));
@@ -876,6 +875,10 @@ void rg_system_switch_app(const char *partition, const char *name, const char *a
876875
rg_settings_set_number(NS_BOOT, SETTING_BOOT_FLAGS, flags);
877876
rg_settings_commit();
878877
}
878+
else
879+
{
880+
rg_storage_delete(RG_BASE_PATH_CONFIG "/boot.json");
881+
}
879882
#if defined(ESP_PLATFORM)
880883
// Check if the OTA settings are already correct, and if so do not call esp_ota_set_boot_partition
881884
// This is simply to avoid an unecessary flash write...

0 commit comments

Comments
 (0)