hekate/nyx: utilize emmc_end

This commit is contained in:
CTCaer 2022-10-11 04:19:29 +03:00
parent 07695196cb
commit 5392971c2c
13 changed files with 31 additions and 33 deletions

View file

@ -557,7 +557,7 @@ static void _dump_emmc_selected(emmcPartType_t dumpType)
gfx_putc('\n');
timer = get_tmr_s() - timer;
gfx_printf("Time taken: %dm %ds.\n", timer / 60, timer % 60);
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res)
gfx_printf("\n%kFinished and verified!%k\nPress any key...\n", TXT_CLR_GREENISH, TXT_CLR_DEFAULT);
@ -892,7 +892,7 @@ static void _restore_emmc_selected(emmcPartType_t restoreType)
gfx_putc('\n');
timer = get_tmr_s() - timer;
gfx_printf("Time taken: %dm %ds.\n", timer / 60, timer % 60);
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res)
gfx_printf("\n%kFinished and verified!%k\nPress any key...\n", TXT_CLR_GREENISH, TXT_CLR_DEFAULT);

View file

@ -239,7 +239,7 @@ void print_mmc_info()
}
out:
sdmmc_storage_end(&emmc_storage);
emmc_end();
btn_wait();
}

View file

@ -233,7 +233,7 @@ out_free:
free(warmboot);
free(loader);
free(pkg2);
sdmmc_storage_end(&emmc_storage);
emmc_end();
sd_end();
if (kb >= KB_FIRMWARE_VERSION_620)
@ -280,7 +280,7 @@ void _toggle_autorcm(bool enable)
}
free(tempbuf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (enable)
gfx_printf("%kAutoRCM mode enabled!%k", TXT_CLR_ORANGE, TXT_CLR_DEFAULT);
@ -333,7 +333,7 @@ void menu_autorcm()
disabled = false;
free(tempbuf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
// Create AutoRCM menu.
ment_t *ments = (ment_t *)malloc(sizeof(ment_t) * 6);

View file

@ -1067,7 +1067,7 @@ int hos_launch(ini_sec_t *cfg)
// Unmount SD card and eMMC.
sd_end();
sdmmc_storage_end(&emmc_storage);
emmc_end();
gfx_printf("Rebuilt & loaded pkg2\n\n%kBooting...%k\n", TXT_CLR_GREENISH, TXT_CLR_DEFAULT);
@ -1176,7 +1176,7 @@ int hos_launch(ini_sec_t *cfg)
bpmp_halt();
error:
sdmmc_storage_end(&emmc_storage);
emmc_end();
return 0;
}

View file

@ -80,7 +80,7 @@ void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t
memcpy(path + strlen(path), filename, filename_len + 1);
if (init_done)
sdmmc_storage_end(&emmc_storage);
emmc_end();
}
void render_default_bootlogo()

View file

@ -177,7 +177,7 @@ out:
int emummc_storage_end()
{
if (!emu_cfg.enabled || h_cfg.emummc_force_disable)
sdmmc_storage_end(&emmc_storage);
emmc_end();
else
sd_end();

View file

@ -912,7 +912,7 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
}
timer = get_tmr_s() - timer;
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res && n_cfg.verification && !gui->raw_emummc)
s_printf(txt_buf, "Time taken: %dm %ds.\n#96FF00 Finished and verified!#", timer / 60, timer % 60);
@ -1536,7 +1536,7 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
}
timer = get_tmr_s() - timer;
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res && n_cfg.verification && !gui->raw_emummc)
s_printf(txt_buf, "Time taken: %dm %ds.\n#96FF00 Finished and verified!#", timer / 60, timer % 60);

View file

@ -474,7 +474,7 @@ void dump_emummc_file(emmc_tool_gui_t *gui)
out_failed:
timer = get_tmr_s() - timer;
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res)
{
@ -864,7 +864,7 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start, u32 r
{
s_printf(gui->txt_buf, "#FFDD00 For formatting USER partition,#\n#FFDD00 BIS keys are needed!#\n");
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
goto out;
}
@ -952,7 +952,7 @@ void dump_emummc_raw(emmc_tool_gui_t *gui, int part_idx, u32 sector_start, u32 r
out_failed:
timer = get_tmr_s() - timer;
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (res)
{

View file

@ -33,8 +33,6 @@ extern hekate_config h_cfg;
extern char *emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage);
lv_obj_t *ums_mbox;
typedef struct _emmc_backup_buttons_t
{
lv_obj_t *emmc_boot;

View file

@ -221,7 +221,7 @@ static void _create_mbox_emummc_raw()
u32 emmc_size_safe = emmc_storage.sec_cnt + 0xC000; // eMMC GPP size + BOOT0/1.
sdmmc_storage_end(&emmc_storage);
emmc_end();
for (int i = 1; i < 4; i++)
{
@ -838,7 +838,7 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
backup = backup && rawnand_backup;
sd_unmount();
sdmmc_storage_end(&emmc_storage);
emmc_end();
// Check available types and enable the corresponding buttons.
if (backup)

View file

@ -376,7 +376,7 @@ static lv_res_t _create_mbox_cal0(lv_obj_t *btn)
out:
free(txt_buf);
sd_unmount();
sdmmc_storage_end(&emmc_storage);
emmc_end();
lv_mbox_add_btns(mbox, mbox_btn_map, _cal0_dump_window_action);
@ -1132,7 +1132,7 @@ static lv_res_t _create_mbox_emmc_sandisk_report(lv_obj_t * btn)
}
int res = sdmmc_storage_vendor_sandisk_report(&emmc_storage, buf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
if (!res)
{
@ -1516,7 +1516,7 @@ error:
if (sd_bench)
sd_unmount();
else
sdmmc_storage_end(&emmc_storage);
emmc_end();
out:
free(txt_buf);
@ -1789,7 +1789,7 @@ static lv_res_t _create_window_emmc_info_status(lv_obj_t *btn)
}
out:
sdmmc_storage_end(&emmc_storage);
emmc_end();
free(txt_buf);
return LV_RES_OK;

View file

@ -124,7 +124,7 @@ bool get_autorcm_status(bool toggle)
out:
free(tempbuf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
return enabled;
}
@ -1422,7 +1422,7 @@ out_free:
free(loader);
free(pkg2);
free(txt_buf);
sdmmc_storage_end(&emmc_storage);
emmc_end();
sd_unmount();
if (kb >= KB_FIRMWARE_VERSION_620)

View file

@ -63,7 +63,7 @@ char *emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_
else
{
itoa(emmc_storage.cid.serial, emmc_sn, 16);
sdmmc_storage_end(&emmc_storage);
emmc_end();
}
}
else