Skip to content

Commit

Permalink
rg_system: Delete boot config after panic or recovery
Browse files Browse the repository at this point in the history
  • Loading branch information
ducalex committed Nov 29, 2024
1 parent e61ed3a commit 78be876
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions components/retro-go/rg_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,7 @@ rg_app_t *rg_system_init(int sampleRate, const rg_handlers_t *handlers, const rg

if (app.bootFlags & RG_BOOT_ONCE)
{
rg_settings_set_string(NS_BOOT, SETTING_BOOT_NAME, "launcher");
rg_settings_commit();
rg_storage_delete(RG_BASE_PATH_CONFIG "/boot.json");
#ifdef ESP_PLATFORM
esp_ota_set_boot_partition(esp_partition_find_first(
ESP_PARTITION_TYPE_APP, ESP_PARTITION_SUBTYPE_ANY, RG_APP_LAUNCHER));
Expand Down Expand Up @@ -876,6 +875,10 @@ void rg_system_switch_app(const char *partition, const char *name, const char *a
rg_settings_set_number(NS_BOOT, SETTING_BOOT_FLAGS, flags);
rg_settings_commit();
}
else
{
rg_storage_delete(RG_BASE_PATH_CONFIG "/boot.json");
}
#if defined(ESP_PLATFORM)
// Check if the OTA settings are already correct, and if so do not call esp_ota_set_boot_partition
// This is simply to avoid an unecessary flash write...
Expand Down

0 comments on commit 78be876

Please sign in to comment.