refactor: Remove all unwanted whitespace
This commit is contained in:
@@ -60,7 +60,7 @@ static void get_valid_partition(u32 *sector_start, u32 *sector_size, u32 *part_i
|
||||
sd_mount();
|
||||
u8 *mbr = (u8 *)malloc(0x200);
|
||||
sdmmc_storage_read(&sd_storage, 0, 1, mbr);
|
||||
|
||||
|
||||
memcpy(mbr, mbr + 0x1BE, 0x40);
|
||||
|
||||
*part_idx = 0;
|
||||
@@ -106,7 +106,7 @@ static void get_valid_partition(u32 *sector_start, u32 *sector_size, u32 *part_i
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
out:
|
||||
free(mbr);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32
|
||||
"#FF0000 Aborting..#\n", res);
|
||||
lv_label_ins_text(gui->label_log, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32
|
||||
while (totalSectorsVer > 0)
|
||||
{
|
||||
num = MIN(totalSectorsVer, NUM_SECTORS_PER_ITER);
|
||||
|
||||
|
||||
// Check every time or every 4.
|
||||
// Every 4 protects from fake sd, sector corruption and frequent I/O corruption.
|
||||
// Full provides all that, plus protection from extremely rare I/O corruption.
|
||||
@@ -468,7 +468,7 @@ static int _dump_emmc_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_storage_t
|
||||
gui->base_path, outFilename + strlen(gui->base_path));
|
||||
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
res = f_open(&fp, outFilename, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (res)
|
||||
{
|
||||
@@ -626,7 +626,7 @@ static int _dump_emmc_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_storage_t
|
||||
}
|
||||
|
||||
res = f_write_fast(&fp, buf, NX_EMMC_BLOCKSIZE * num);
|
||||
|
||||
|
||||
if (res)
|
||||
{
|
||||
s_printf(gui->txt_buf, "\n#FF0000 Fatal error (%d) when writing to SD Card#\nPlease try again...\n", res);
|
||||
@@ -883,7 +883,7 @@ void dump_emmc_selected(emmcPartType_t dumpType, emmc_tool_gui_t *gui)
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.\nFinished!", timer / 60, timer % 60);
|
||||
else
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.", timer / 60, timer % 60);
|
||||
|
||||
|
||||
lv_label_set_array_text(gui->label_finish, txt_buf, 0x1000);
|
||||
|
||||
out:
|
||||
@@ -1450,7 +1450,7 @@ void restore_emmc_selected(emmcPartType_t restoreType, emmc_tool_gui_t *gui)
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.\nFinished!", timer / 60, timer % 60);
|
||||
else
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.", timer / 60, timer % 60);
|
||||
|
||||
|
||||
lv_label_set_array_text(gui->label_finish, txt_buf, 0x1000);
|
||||
|
||||
out:
|
||||
|
||||
@@ -162,7 +162,7 @@ static int _dump_emummc_file_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_sto
|
||||
gui->base_path, outFilename + strlen(gui->base_path));
|
||||
lv_label_ins_text(gui->label_info, LV_LABEL_POS_LAST, gui->txt_buf);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
res = f_open(&fp, outFilename, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
if (res)
|
||||
{
|
||||
@@ -257,7 +257,7 @@ static int _dump_emummc_file_part(emmc_tool_gui_t *gui, char *sd_path, sdmmc_sto
|
||||
}
|
||||
}
|
||||
res = f_write_fast(&fp, buf, NX_EMMC_BLOCKSIZE * num);
|
||||
|
||||
|
||||
if (res)
|
||||
{
|
||||
s_printf(gui->txt_buf, "\n#FF0000 Fatal error (%d) when writing to SD Card#\nPlease try again...\n", res);
|
||||
@@ -441,13 +441,13 @@ out_failed:
|
||||
FIL fp;
|
||||
f_open(&fp, sdPath, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
f_close(&fp);
|
||||
|
||||
|
||||
gui->base_path[strlen(gui->base_path) - 1] = 0;
|
||||
save_emummc_cfg(0, 0, gui->base_path);
|
||||
}
|
||||
else
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.", timer / 60, timer % 60);
|
||||
|
||||
|
||||
lv_label_set_array_text(gui->label_finish, txt_buf, 0x1000);
|
||||
|
||||
out:
|
||||
@@ -695,13 +695,13 @@ out_failed:
|
||||
f_open(&fp, sdPath, FA_CREATE_ALWAYS | FA_WRITE);
|
||||
f_write(&fp, §or_start, 4, NULL);
|
||||
f_close(&fp);
|
||||
|
||||
|
||||
gui->base_path[strlen(gui->base_path) - 1] = 0;
|
||||
save_emummc_cfg(part_idx, sector_start, gui->base_path);
|
||||
}
|
||||
else
|
||||
s_printf(txt_buf, "Time taken: %dm %ds.", timer / 60, timer % 60);
|
||||
|
||||
|
||||
lv_label_set_array_text(gui->label_finish, txt_buf, 0x1000);
|
||||
|
||||
out:
|
||||
|
||||
@@ -191,9 +191,9 @@ static bool _fts_touch_read(lv_indev_data_t *data)
|
||||
// Always set touch points.
|
||||
data->point.x = touchpad.x;
|
||||
data->point.y = touchpad.y;
|
||||
|
||||
|
||||
// Decide touch enable.
|
||||
switch (touchpad.type & STMFTS_MASK_EVENT_ID)
|
||||
switch (touchpad.type & STMFTS_MASK_EVENT_ID)
|
||||
{
|
||||
case STMFTS_EV_MULTI_TOUCH_ENTER:
|
||||
case STMFTS_EV_MULTI_TOUCH_MOTION:
|
||||
@@ -284,7 +284,7 @@ lv_img_dsc_t *bmp_to_lvimg_obj(const char *path)
|
||||
|
||||
lv_img_dsc_t *img_desc = (lv_img_dsc_t *)bitmap;
|
||||
u32 offset_copy = ALIGN((u32)bitmap + sizeof(lv_img_dsc_t), 0x10);
|
||||
|
||||
|
||||
img_desc->header.always_zero = 0;
|
||||
img_desc->header.w = bmpData.size_x;
|
||||
img_desc->header.h = bmpData.size_y;
|
||||
@@ -315,7 +315,7 @@ lv_img_dsc_t *bmp_to_lvimg_obj(const char *path)
|
||||
tmp2[j++] = tmp[y * bmpData.size_x + x];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
free(tmp);
|
||||
}
|
||||
else
|
||||
@@ -323,7 +323,7 @@ lv_img_dsc_t *bmp_to_lvimg_obj(const char *path)
|
||||
free(bitmap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return (lv_img_dsc_t *)bitmap;
|
||||
}
|
||||
|
||||
@@ -367,7 +367,7 @@ lv_res_t mbox_action(lv_obj_t *btns, const char *txt)
|
||||
{
|
||||
lv_obj_t *mbox = lv_mbox_get_from_btn(btns);
|
||||
lv_obj_t *dark_bg = lv_obj_get_parent(mbox);
|
||||
|
||||
|
||||
lv_obj_del(dark_bg); // Deletes children also (mbox).
|
||||
|
||||
return LV_RES_INV;
|
||||
@@ -401,7 +401,6 @@ void nyx_window_toggle_buttons(lv_obj_t *win, bool disable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lv_obj_t *nyx_create_standard_window(const char *win_title)
|
||||
{
|
||||
@@ -551,7 +550,7 @@ static lv_res_t _create_mbox_reload(lv_obj_t *btn)
|
||||
lv_obj_set_width(mbox, LV_HOR_RES * 4 / 10);
|
||||
|
||||
lv_mbox_set_text(mbox, "#FF8000 Do you really want#\n#FF8000 to reload hekate?#");
|
||||
|
||||
|
||||
lv_mbox_add_btns(mbox, mbox_btn_map, reload_action);
|
||||
|
||||
lv_obj_align(mbox, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
@@ -627,7 +626,7 @@ void nyx_create_onoff_button(lv_theme_t *th, lv_obj_t *parent, lv_obj_t *btn, co
|
||||
|
||||
lv_obj_t *label_btn = lv_label_create(btn, NULL);
|
||||
lv_obj_t *label_btnsw = NULL;
|
||||
|
||||
|
||||
lv_label_set_recolor(label_btn, true);
|
||||
label_btnsw = lv_label_create(btn, NULL);
|
||||
lv_label_set_recolor(label_btnsw, true);
|
||||
@@ -797,7 +796,7 @@ static void _update_status_bar(void *params)
|
||||
|
||||
lv_obj_realign(status_bar.temp_symbol);
|
||||
lv_obj_realign(status_bar.temp_degrees);
|
||||
|
||||
|
||||
// Set battery percent and charging symbol.
|
||||
s_printf(label, " "SYMBOL_DOT" %d.%d%% ", (batt_percent >> 8) & 0xFF, (batt_percent & 0xFF) / 26);
|
||||
|
||||
@@ -824,7 +823,7 @@ static void _update_status_bar(void *params)
|
||||
s_printf(label, "#96FF00 +%d", batt_curr / 1000);
|
||||
else
|
||||
s_printf(label, "#FF3C28 -%d", (~batt_curr + 1) / 1000);
|
||||
|
||||
|
||||
s_printf(label + strlen(label), " mA# (%d mV)", batt_volt);
|
||||
|
||||
lv_label_set_array_text(status_bar.battery_more, label, 64);
|
||||
@@ -1132,7 +1131,7 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn)
|
||||
|
||||
// Enable button.
|
||||
lv_obj_set_opa_scale(launch_ctxt[x], LV_OPA_COVER);
|
||||
|
||||
|
||||
// Default to switch logo if no icon found at all.
|
||||
if (!bmp)
|
||||
bmp = icon_switch;
|
||||
@@ -1157,7 +1156,7 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn)
|
||||
ext->idx = i;
|
||||
ext = lv_obj_get_ext_attr(launch_ctxt[x]); // Redundancy.
|
||||
ext->idx = i;
|
||||
|
||||
|
||||
// Set action.
|
||||
if (!more_cfg)
|
||||
lv_btn_set_action(btn, LV_BTN_ACTION_CLICK, _launch_action);
|
||||
@@ -1210,7 +1209,7 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn)
|
||||
"Check that a .ini file exists in #96FF00 /bootloader/ini/#,\n"
|
||||
"and that it contains at least one entry.");
|
||||
}
|
||||
|
||||
|
||||
lv_obj_set_pos(label_error, 19, 0);
|
||||
}
|
||||
|
||||
@@ -1420,7 +1419,7 @@ static lv_res_t _show_hide_save_button(lv_obj_t *tv, uint16_t tab_idx)
|
||||
lv_obj_set_opa_scale(status_bar.mid, LV_OPA_0);
|
||||
lv_obj_set_click(status_bar.mid, false);
|
||||
}
|
||||
|
||||
|
||||
return LV_RES_OK;
|
||||
}
|
||||
|
||||
@@ -1529,14 +1528,14 @@ static void _nyx_main_menu(lv_theme_t * th)
|
||||
}
|
||||
lv_tabview_set_sliding(tv, false);
|
||||
lv_obj_set_size(tv, LV_HOR_RES, LV_VER_RES);
|
||||
|
||||
|
||||
// Add all tabs content.
|
||||
char version[32];
|
||||
s_printf(version, "hekate v%d.%d.%d", nyx_str->version & 0xFF, (nyx_str->version >> 8) & 0xFF, (nyx_str->version >> 16) & 0xFF);
|
||||
lv_obj_t *tab_about = lv_tabview_add_tab(tv, version);
|
||||
|
||||
lv_obj_t *tab_home = lv_tabview_add_tab(tv, SYMBOL_HOME" Home");
|
||||
|
||||
|
||||
lv_obj_t *tab_tools = lv_tabview_add_tab(tv, SYMBOL_TOOLS" Tools");
|
||||
lv_page_set_style(tab_tools, LV_PAGE_STYLE_BG, &no_padding);
|
||||
lv_page_set_style(tab_tools, LV_PAGE_STYLE_SCRL, &no_padding);
|
||||
@@ -1546,7 +1545,7 @@ static void _nyx_main_menu(lv_theme_t * th)
|
||||
lv_page_set_style(tab_info, LV_PAGE_STYLE_SCRL, &no_padding);
|
||||
|
||||
lv_obj_t *tab_options = lv_tabview_add_tab(tv, SYMBOL_SETTINGS" Options");
|
||||
|
||||
|
||||
_create_tab_about(th, tab_about);
|
||||
_create_tab_home(th, tab_home);
|
||||
create_tab_tools(th, tab_tools);
|
||||
@@ -1561,10 +1560,10 @@ static void _nyx_main_menu(lv_theme_t * th)
|
||||
// Create tasks.
|
||||
system_tasks.task.dram_periodic_comp = lv_task_create(minerva_periodic_training, EMC_PERIODIC_TRAIN_MS, LV_TASK_PRIO_HIGHEST, NULL);
|
||||
lv_task_ready(system_tasks.task.dram_periodic_comp);
|
||||
|
||||
|
||||
system_tasks.task.status_bar = lv_task_create(_update_status_bar, 5000, LV_TASK_PRIO_LOW, NULL);
|
||||
lv_task_ready(system_tasks.task.status_bar);
|
||||
|
||||
|
||||
lv_task_create(_check_sd_card_removed, 2000, LV_TASK_PRIO_LOWEST, NULL);
|
||||
|
||||
// Create top level global line separators.
|
||||
|
||||
@@ -326,7 +326,7 @@ lv_res_t create_window_backup_restore_tool(lv_obj_t *btn)
|
||||
lv_label_set_static_text(label_btn, SYMBOL_UPLOAD" eMMC BOOT0 & BOOT1");
|
||||
else
|
||||
lv_label_set_static_text(label_btn, SYMBOL_DOWNLOAD" eMMC BOOT0 & BOOT1");
|
||||
|
||||
|
||||
lv_obj_align(btn1, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 4);
|
||||
lv_btn_set_action(btn1, LV_BTN_ACTION_CLICK, _emmc_backup_buttons_decider);
|
||||
emmc_btn_ctxt.emmc_boot = btn1;
|
||||
@@ -427,7 +427,7 @@ lv_res_t create_window_backup_restore_tool(lv_obj_t *btn)
|
||||
"Allows you to restore ALL partitions from RAW GPP\n"
|
||||
"It contains, CAL0, various package2, SYSTEM, USER, etc.\n");
|
||||
}
|
||||
|
||||
|
||||
lv_obj_set_style(label_txt4, &hint_small_style);
|
||||
lv_obj_align(label_txt4, btn3, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ static void _create_window_emummc()
|
||||
//Disable buttons.
|
||||
nyx_window_toggle_buttons(win, true);
|
||||
|
||||
// Chreate important info container.
|
||||
// Create important info container.
|
||||
lv_obj_t *h1 = lv_cont_create(win, NULL);
|
||||
lv_cont_set_fit(h1, false, true);
|
||||
lv_obj_set_width(h1, (LV_HOR_RES / 9) * 5);
|
||||
@@ -121,7 +121,7 @@ static void _create_window_emummc()
|
||||
lv_obj_set_style(label_finish, lv_theme_get_current()->label.prim);
|
||||
lv_obj_align(label_finish, bar, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI * 9 / 20);
|
||||
emmc_tool_gui_ctxt.label_finish = label_finish;
|
||||
|
||||
|
||||
if (!part_idx)
|
||||
dump_emummc_file(&emmc_tool_gui_ctxt);
|
||||
else
|
||||
@@ -184,7 +184,7 @@ static void _create_mbox_emummc_raw()
|
||||
part_idx = i;
|
||||
sector_start += 0x8000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sdmmc_storage_end(&storage);
|
||||
@@ -521,7 +521,7 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
|
||||
sd_mount();
|
||||
sdmmc_storage_read(&sd_storage, 0, 1, mbr);
|
||||
|
||||
|
||||
memcpy(mbr, mbr + 0x1BE, 0x40);
|
||||
|
||||
sdmmc_storage_t storage;
|
||||
@@ -558,7 +558,7 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//! TODO: What about unallocated
|
||||
@@ -593,7 +593,7 @@ static lv_res_t _create_mbox_emummc_migrate(lv_obj_t *btn)
|
||||
backup = true;
|
||||
else
|
||||
backup = false;
|
||||
|
||||
|
||||
sd_unmount(false);
|
||||
sdmmc_storage_end(&storage);
|
||||
|
||||
@@ -671,7 +671,7 @@ static lv_res_t _save_emummc_cfg_mbox_action(lv_obj_t *btns, const char *txt)
|
||||
lv_obj_del(emummc_img->win);
|
||||
lv_obj_del(emummc_manage_window);
|
||||
free(emummc_img);
|
||||
|
||||
|
||||
mbox_action(btns, txt);
|
||||
|
||||
(*emummc_tools)(NULL);
|
||||
@@ -727,7 +727,6 @@ static lv_res_t _save_disable_emummc_cfg_action(lv_obj_t * btn)
|
||||
save_emummc_cfg(0, 0, NULL);
|
||||
_create_emummc_saved_mbox();
|
||||
sd_unmount(false);
|
||||
|
||||
|
||||
return LV_RES_INV;
|
||||
}
|
||||
@@ -902,9 +901,9 @@ out0:;
|
||||
}
|
||||
else
|
||||
lv_obj_align(btn, lv_desc, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
|
||||
|
||||
|
||||
lv_btn_set_action(btn, LV_BTN_ACTION_CLICK, _save_raw_emummc_cfg_action);
|
||||
|
||||
|
||||
lv_desc = lv_label_create(h1, lv_desc);
|
||||
lv_label_set_recolor(lv_desc, true);
|
||||
lv_obj_set_style(lv_desc, &hint_small_style);
|
||||
@@ -1070,7 +1069,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
{
|
||||
lv_label_set_static_text(label_txt2, "emuMMC is disabled and eMMC will be used for boot.\n\n");
|
||||
}
|
||||
|
||||
|
||||
free(txt_buf);
|
||||
|
||||
lv_obj_set_style(label_txt2, &hint_small_style);
|
||||
@@ -1127,7 +1126,7 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn)
|
||||
lv_label_set_static_text(label_txt4,
|
||||
"Allows you to create a new #C7EA46 SD File# or #C7EA46 SD Raw Partition#\n"
|
||||
"emuMMC. You can create it from eMMC or a eMMC Backup.");
|
||||
|
||||
|
||||
lv_obj_set_style(label_txt4, &hint_small_style);
|
||||
lv_obj_align(label_txt4, btn3, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
|
||||
|
||||
|
||||
@@ -127,23 +127,23 @@ static lv_res_t _bootrom_dump_window_action(lv_obj_t * btn)
|
||||
}
|
||||
else
|
||||
error = 255;
|
||||
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "bootrom_patched.bin", NULL);
|
||||
int res = sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path);
|
||||
if (!error)
|
||||
error = res;
|
||||
|
||||
|
||||
u32 ipatch_backup[14];
|
||||
memcpy(ipatch_backup, (void *)IPATCH_BASE, sizeof(ipatch_backup));
|
||||
memset((void*)IPATCH_BASE, 0, sizeof(ipatch_backup));
|
||||
|
||||
|
||||
emmcsn_path_impl(path, "/dumps", "bootrom_unpatched.bin", NULL);
|
||||
res = sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path);
|
||||
if (!error)
|
||||
error = res;
|
||||
|
||||
|
||||
memcpy((void*)IPATCH_BASE, ipatch_backup, sizeof(ipatch_backup));
|
||||
|
||||
|
||||
sd_unmount(false);
|
||||
}
|
||||
_create_window_dump_done(error, "evp_thunks.bin, bootrom_patched.bin, bootrom_unpatched.bin");
|
||||
@@ -504,13 +504,13 @@ static lv_res_t _create_window_tsec_keys_status(lv_obj_t *btn)
|
||||
s_printf(txt_buf + strlen(txt_buf), "#C7EA46 TSEC Key:#\n");
|
||||
if (res >= 0)
|
||||
{
|
||||
s_printf(txt_buf2, "\n%08X%08X%08X%08X\n",
|
||||
byte_swap_32(tsec_keys[0]), byte_swap_32(tsec_keys[1]), byte_swap_32(tsec_keys[2]), byte_swap_32(tsec_keys[3]));
|
||||
s_printf(txt_buf2, "\n%08X%08X%08X%08X\n",
|
||||
byte_swap_32(tsec_keys[0]), byte_swap_32(tsec_keys[1]), byte_swap_32(tsec_keys[2]), byte_swap_32(tsec_keys[3]));
|
||||
|
||||
if (pkg1_id->kb == KB_FIRMWARE_VERSION_620)
|
||||
{
|
||||
s_printf(txt_buf + strlen(txt_buf), "#C7EA46 TSEC root:#\n");
|
||||
s_printf(txt_buf2 + strlen(txt_buf2), "%08X%08X%08X%08X\n",
|
||||
s_printf(txt_buf2 + strlen(txt_buf2), "%08X%08X%08X%08X\n",
|
||||
byte_swap_32(tsec_keys[4]), byte_swap_32(tsec_keys[5]), byte_swap_32(tsec_keys[6]), byte_swap_32(tsec_keys[7]));
|
||||
}
|
||||
lv_win_add_btn(win, NULL, SYMBOL_DOWNLOAD" Dump Keys", _tsec_keys_dump_window_action);
|
||||
@@ -838,7 +838,7 @@ static lv_res_t _create_window_battery_status(lv_obj_t *btn)
|
||||
lv_obj_t * lb_desc = lv_label_create(desc, NULL);
|
||||
lv_label_set_long_mode(lb_desc, LV_LABEL_LONG_BREAK);
|
||||
lv_label_set_recolor(lb_desc, true);
|
||||
|
||||
|
||||
lv_label_set_static_text(lb_desc,
|
||||
"#00DDFF Fuel Gauge IC Info:#\n"
|
||||
"Capacity now:\n"
|
||||
@@ -1080,7 +1080,7 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_label_set_static_text(label_btn, SYMBOL_CIRCUIT" Fuses ");
|
||||
lv_obj_align(btn3, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 4, LV_DPI / 2);
|
||||
lv_btn_set_action(btn3, LV_BTN_ACTION_CLICK, _create_window_fuses_info_status);
|
||||
|
||||
|
||||
// Create KFuses button.
|
||||
lv_obj_t *btn4 = lv_btn_create(h1, btn);
|
||||
label_btn = lv_label_create(btn4, NULL);
|
||||
@@ -1130,7 +1130,7 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_label_set_static_text(label_btn, SYMBOL_CHIP" eMMC ");
|
||||
lv_obj_align(btn5, line_sep, LV_ALIGN_OUT_BOTTOM_LEFT, LV_DPI / 2, LV_DPI / 4);
|
||||
lv_btn_set_action(btn5, LV_BTN_ACTION_CLICK, _create_window_emmc_info_status);
|
||||
|
||||
|
||||
// Create microSD button.
|
||||
lv_obj_t *btn6 = lv_btn_create(h2, btn);
|
||||
label_btn = lv_label_create(btn6, NULL);
|
||||
|
||||
@@ -321,7 +321,7 @@ void create_tab_options(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_btn_set_style(btn, LV_BTN_STYLE_REL, &btn_transp_rel);
|
||||
lv_btn_set_style(btn, LV_BTN_STYLE_PR, &btn_transp_pr);
|
||||
lv_btn_set_style(btn, LV_BTN_STYLE_TGL_REL, &btn_transp_tgl_rel);
|
||||
lv_btn_set_style(btn, LV_BTN_STYLE_TGL_PR, &btn_transp_tgl_pr);
|
||||
lv_btn_set_style(btn, LV_BTN_STYLE_TGL_PR, &btn_transp_tgl_pr);
|
||||
}
|
||||
lv_btn_set_layout(btn, LV_LAYOUT_OFF);
|
||||
lv_obj_t *label_btn = lv_label_create(btn, NULL);
|
||||
@@ -372,7 +372,7 @@ void create_tab_options(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_BG, &ddlist_transp_bg);
|
||||
lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_BGO, &ddlist_transp_bg);
|
||||
lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_PR, &ddlist_transp_sel);
|
||||
lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_SEL, &ddlist_transp_sel);
|
||||
lv_ddlist_set_style(ddlist, LV_DDLIST_STYLE_SEL, &ddlist_transp_sel);
|
||||
}
|
||||
|
||||
label_txt2 = lv_label_create(l_cont, NULL);
|
||||
@@ -464,7 +464,7 @@ void create_tab_options(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_ddlist_set_style(ddlist2, LV_DDLIST_STYLE_BG, &ddlist_transp_bg);
|
||||
lv_ddlist_set_style(ddlist2, LV_DDLIST_STYLE_BGO, &ddlist_transp_bg);
|
||||
lv_ddlist_set_style(ddlist2, LV_DDLIST_STYLE_PR, &ddlist_transp_sel);
|
||||
lv_ddlist_set_style(ddlist2, LV_DDLIST_STYLE_SEL, &ddlist_transp_sel);
|
||||
lv_ddlist_set_style(ddlist2, LV_DDLIST_STYLE_SEL, &ddlist_transp_sel);
|
||||
}
|
||||
|
||||
label_txt2 = lv_label_create(sw_h3, NULL);
|
||||
|
||||
@@ -50,7 +50,7 @@ bool get_autorcm_status(bool change)
|
||||
sdmmc_storage_t storage;
|
||||
sdmmc_t sdmmc;
|
||||
bool enabled = false;
|
||||
|
||||
|
||||
sdmmc_storage_init_mmc(&storage, &sdmmc, SDMMC_4, SDMMC_BUS_WIDTH_8, 4);
|
||||
|
||||
u8 *tempbuf = (u8 *)malloc(0x200);
|
||||
@@ -383,7 +383,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
emmcsn_path_impl(path, "/pkg1", "pkg1_enc.bin", &storage);
|
||||
if (sd_save_to_file(pkg1, 0x40000, path))
|
||||
goto out_free;
|
||||
|
||||
|
||||
s_printf(txt_buf + strlen(txt_buf), "\nEncrypted pkg1 dumped to pkg1_enc.bin");
|
||||
lv_label_set_array_text(lb_desc, txt_buf, 0x1000);
|
||||
manual_system_maintenance(true);
|
||||
@@ -431,9 +431,9 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
if (kb <= KB_FIRMWARE_VERSION_620)
|
||||
{
|
||||
pkg1_unpack(warmboot, secmon, loader, pkg1_id, pkg1);
|
||||
|
||||
|
||||
// Display info.
|
||||
s_printf(txt_buf + strlen(txt_buf),
|
||||
s_printf(txt_buf + strlen(txt_buf),
|
||||
"#C7EA46 NX Bootloader size: #0x%05X\n"
|
||||
"#C7EA46 Secure monitor addr: #0x%05X\n"
|
||||
"#C7EA46 Secure monitor size: #0x%05X\n"
|
||||
@@ -451,7 +451,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
s_printf(txt_buf + strlen(txt_buf), "pkg1 dumped to pkg1_decr.bin\n");
|
||||
lv_label_set_array_text(lb_desc, txt_buf, 0x1000);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
// Dump nxbootloader.
|
||||
emmcsn_path_impl(path, "/pkg1", "nxloader.bin", &storage);
|
||||
if (sd_save_to_file(loader, hdr->ldr_size, path))
|
||||
@@ -459,7 +459,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
s_printf(txt_buf + strlen(txt_buf), "NX Bootloader dumped to nxloader.bin\n");
|
||||
lv_label_set_array_text(lb_desc, txt_buf, 0x1000);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
// Dump secmon.
|
||||
emmcsn_path_impl(path, "/pkg1", "secmon.bin", &storage);
|
||||
if (sd_save_to_file(secmon, hdr->sm_size, path))
|
||||
@@ -467,7 +467,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
s_printf(txt_buf + strlen(txt_buf), "Secure Monitor dumped to secmon.bin\n");
|
||||
lv_label_set_array_text(lb_desc, txt_buf, 0x1000);
|
||||
manual_system_maintenance(true);
|
||||
|
||||
|
||||
// Dump warmboot.
|
||||
emmcsn_path_impl(path, "/pkg1", "warmboot.bin", &storage);
|
||||
if (sd_save_to_file(warmboot, hdr->wb_size, path))
|
||||
@@ -496,7 +496,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
// Read in package2.
|
||||
u32 pkg2_size_aligned = ALIGN(pkg2_size, NX_EMMC_BLOCKSIZE);
|
||||
pkg2 = malloc(pkg2_size_aligned);
|
||||
nx_emmc_part_read(&storage, pkg2_part, 0x4000 / NX_EMMC_BLOCKSIZE,
|
||||
nx_emmc_part_read(&storage, pkg2_part, 0x4000 / NX_EMMC_BLOCKSIZE,
|
||||
pkg2_size_aligned / NX_EMMC_BLOCKSIZE, pkg2);
|
||||
#if 0
|
||||
emmcsn_path_impl(path, "/pkg2", "pkg2_encr.bin", &storage);
|
||||
@@ -517,7 +517,7 @@ static lv_res_t _create_window_dump_pk12_tool(lv_obj_t *btn)
|
||||
}
|
||||
|
||||
// Display info.
|
||||
s_printf(txt_buf + strlen(txt_buf),
|
||||
s_printf(txt_buf + strlen(txt_buf),
|
||||
"#C7EA46 Kernel size: #0x%05X\n"
|
||||
"#C7EA46 INI1 size: #0x%05X\n\n",
|
||||
pkg2_hdr->sec_size[PKG2_SEC_KERNEL], pkg2_hdr->sec_size[PKG2_SEC_INI1]);
|
||||
@@ -819,7 +819,7 @@ static void _create_tab_tools_arc_autorcm(lv_theme_t *th, lv_obj_t *parent)
|
||||
lv_btn_set_style(btn3, LV_BTN_STYLE_REL, &btn_transp_rel);
|
||||
lv_btn_set_style(btn3, LV_BTN_STYLE_PR, &btn_transp_pr);
|
||||
lv_btn_set_style(btn3, LV_BTN_STYLE_TGL_REL, &btn_transp_tgl_rel);
|
||||
lv_btn_set_style(btn3, LV_BTN_STYLE_TGL_PR, &btn_transp_tgl_pr);
|
||||
lv_btn_set_style(btn3, LV_BTN_STYLE_TGL_PR, &btn_transp_tgl_pr);
|
||||
}
|
||||
label_btn = lv_label_create(btn3, NULL);
|
||||
lv_btn_set_fit(btn3, true, true);
|
||||
@@ -885,7 +885,7 @@ void create_tab_tools(lv_theme_t *th, lv_obj_t *parent)
|
||||
|
||||
lv_tabview_set_sliding(tv, false);
|
||||
lv_tabview_set_btns_pos(tv, LV_TABVIEW_BTNS_POS_BOTTOM);
|
||||
|
||||
|
||||
lv_obj_t *tab1= lv_tabview_add_tab(tv, "eMMC "SYMBOL_DOT" Package1/2");
|
||||
lv_obj_t *tab2 = lv_tabview_add_tab(tv, "Archive bit "SYMBOL_DOT" AutoRCM");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user