Change some messages and other stuff

This commit is contained in:
Christoph Baumann
2025-05-19 01:27:30 +02:00
parent 7ebceb78bd
commit 865b9dc1a4
4 changed files with 14 additions and 15 deletions

View File

@@ -770,14 +770,16 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
lv_label_set_text(gui->label_info, "Checking for available free space...");
manual_system_maintenance(true);
if (!sd_mount())
if (!boot_storage_mount())
{
lv_label_set_text(gui->label_info, "#FFDD00 Failed to init SD!#");
lv_label_set_text(gui->label_info, "#FFDD00 Failed to storage!#");
goto out;
}
// Get SD Card free space for Partial Backup.
f_getfree("", &sd_fs.free_clst, NULL);
FATFS *fs = boot_storage_get_fs();
f_getfree("", &fs->free_clst, NULL);
if (!emmc_initialize(false))
{

View File

@@ -426,12 +426,12 @@ static int _dump_emummc_file_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_sto
FATFS *fs = drive == DRIVE_SD ? &sd_fs : &emmc_fs;
if(drive == DRIVE_SD){
free_space = (u32)(fs->free_clst * fs->csize >> SECTORS_TO_MIB_COEFF);
free_space = (u32)((fs->free_clst * fs->csize) >> SECTORS_TO_MIB_COEFF);
s_printf(gui->txt_buf, "#96FF00 SD Card free space:# %d MiB\n#96FF00 Total size:# %d MiB\n\n",
free_space,
sectors_left >> SECTORS_TO_MIB_COEFF);
}else{
free_space = (u32)(fs->free_clst * fs->csize >> SECTORS_TO_MIB_COEFF);
free_space = (u32)((fs->free_clst * fs->csize) >> SECTORS_TO_MIB_COEFF);
s_printf(gui->txt_buf, "#96FF00 eMMC free space:# %d MiB\n#96FF00 Total size:# %d MiB\n\n",
free_space,
sectors_left >> SECTORS_TO_MIB_COEFF);

View File

@@ -240,15 +240,15 @@ static lv_res_t _emmc_backup_buttons_raw_toggle(lv_obj_t *btn)
else // Backup/Restore from and to emuMMC.
{
if (!emmc_btn_ctxt.restore)
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_UPLOAD" SD emuMMC BOOT0 & BOOT1");
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_UPLOAD" emuMMC BOOT0 & BOOT1");
else
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_DOWNLOAD" SD emuMMC BOOT0 & BOOT1");
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_boot, NULL), SYMBOL_DOWNLOAD" emuMMC BOOT0 & BOOT1");
lv_obj_realign(emmc_btn_ctxt.emmc_boot);
if (!emmc_btn_ctxt.restore)
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_UPLOAD" SD emuMMC RAW GPP");
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_UPLOAD" emuMMC RAW GPP");
else
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_DOWNLOAD" SD emuMMC RAW GPP");
lv_label_set_static_text(lv_obj_get_child(emmc_btn_ctxt.emmc_raw_gpp, NULL), SYMBOL_DOWNLOAD" emuMMC RAW GPP");
lv_obj_realign(emmc_btn_ctxt.emmc_raw_gpp);
lv_obj_set_click(emmc_btn_ctxt.emmc_sys, false);
@@ -454,7 +454,7 @@ lv_res_t create_window_backup_restore_tool(lv_obj_t *btn)
lv_obj_t *sd_emummc_raw = lv_btn_create(h3, NULL);
nyx_create_onoff_button(lv_theme_get_current(), h3,
sd_emummc_raw, SYMBOL_SD" SD emuMMC Raw Partition", _emmc_backup_buttons_raw_toggle, false);
sd_emummc_raw, SYMBOL_SD" emuMMC Raw Partition", _emmc_backup_buttons_raw_toggle, false);
emmc_btn_ctxt.raw_emummc = false;
return LV_RES_OK;

View File

@@ -300,15 +300,12 @@ static int _stat_and_copy_files(const char *src, const char *dst, char *path, u3
u32 chunk_size = MIN(file_bytes_left, SZ_4M); // 4MB chunks.
file_bytes_left -= chunk_size;
u32 res1;
// Copy file to buffer.
res1 = f_read(&fp_src, (void *)SDXC_BUF_ALIGNED, chunk_size, NULL);
DBG_PRINT_ARGS("res read: %d", res1);
f_read(&fp_src, (void *)SDXC_BUF_ALIGNED, chunk_size, NULL);
manual_system_maintenance(true);
// Write file to disk.
res1 = f_write(&fp_dst, (void *)SDXC_BUF_ALIGNED, chunk_size, NULL);
DBG_PRINT_ARGS("res write: %d", res1);
f_write(&fp_dst, (void *)SDXC_BUF_ALIGNED, chunk_size, NULL);
}