From f35c5b059625aeb29ecebffb78e65f1bee9f8cbd Mon Sep 17 00:00:00 2001 From: CTCaer Date: Fri, 28 Jul 2023 03:32:33 +0300 Subject: [PATCH] nyx: fix first time config save unmounting SD card should not get unmounted on the first boot without hekate_ipl.ini. Move sd card mounting management outside of it. --- nyx/nyx_gui/config.c | 4 ---- nyx/nyx_gui/frontend/gui.c | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/nyx/nyx_gui/config.c b/nyx/nyx_gui/config.c index 0191ecd..b70d437 100644 --- a/nyx/nyx_gui/config.c +++ b/nyx/nyx_gui/config.c @@ -64,9 +64,6 @@ void set_nyx_default_configuration() int create_config_entry() { - if (!sd_mount()) - return 1; - char lbuf[64]; FIL fp; bool mainIniFound = false; @@ -184,7 +181,6 @@ int create_config_entry() } f_close(&fp); - sd_unmount(); return 0; } diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 6d8604b..6dd4506 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -2073,7 +2073,10 @@ static lv_res_t _save_options_action(lv_obj_t *btn) lv_obj_t * mbox = lv_mbox_create(lv_scr_act(), NULL); lv_mbox_set_recolor_text(mbox, true); - int res = !create_config_entry(); + int res = 0; + + if (sd_mount()) + res = create_config_entry(); if (res) lv_mbox_set_text(mbox, "#FF8000 hekate Configuration#\n\n#96FF00 The configuration was saved to sd card!#"); @@ -2084,6 +2087,8 @@ static lv_res_t _save_options_action(lv_obj_t *btn) nyx_options_clear_ini_changes_made(); + sd_unmount(); + return LV_RES_OK; }