refactor: Remove all unwanted whitespace

This commit is contained in:
Kostas Missos
2019-10-18 18:02:06 +03:00
parent 9104b85143
commit 7c42f72b8a
135 changed files with 842 additions and 841 deletions

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018-2019 CTCaer
* Copyright (c) 2018-2019 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -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:

View File

@@ -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, &sector_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:

View File

@@ -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.

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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);

View File

@@ -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");

View File

@@ -258,6 +258,7 @@ void display_color_screen(u32 color)
DISPLAY_A(_DIREG(DC_WIN_CD_WIN_OPTIONS)) = 0;
DISPLAY_A(_DIREG(DC_DISP_BLEND_BACKGROUND_COLOR)) = color;
DISPLAY_A(_DIREG(DC_CMD_STATE_CONTROL)) = (DISPLAY_A(_DIREG(DC_CMD_STATE_CONTROL)) & 0xFFFFFFFE) | GENERAL_ACT_REQ;
usleep(35000);
display_backlight(true);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -415,7 +415,7 @@ static const cfg_op_t _display_config_11[113] = {
{DC_DISP_SYNC_WIDTH, 0x10048},
{DC_DISP_BACK_PORCH, 0x90048},
{DC_DISP_ACTIVE, 0x50002D0},
{DC_DISP_FRONT_PORCH, 0xA0088}, // Sources say that this should be above the DC_DISP_ACTIVE cmd.
{DC_DISP_FRONT_PORCH, 0xA0088}, // Sources say that this should be above the DC_DISP_ACTIVE cmd.
/* End of Display timings */
{DC_DISP_SHIFT_CLOCK_OPTIONS, SC1_H_QUALIFIER_NONE | SC0_H_QUALIFIER_NONE},
{DC_COM_PIN_OUTPUT_ENABLE(1), 0},
@@ -557,7 +557,7 @@ static const cfg_op_t cfg_display_framebuffer[32] = {
{DC_DISP_DISP_WIN_OPTIONS, DSI_ENABLE}, //DSI_ENABLE
{DC_WIN_WIN_OPTIONS, 0},
{DC_DISP_DISP_WIN_OPTIONS, DSI_ENABLE}, //DSI_ENABLE
{DC_WIN_WIN_OPTIONS, WIN_ENABLE | V_DIRECTION}, //Enable window AD.
{DC_WIN_WIN_OPTIONS, WIN_ENABLE | V_DIRECTION}, // Enable window AD.
{DC_CMD_DISPLAY_COMMAND, DISP_CTRL_MODE_C_DISPLAY}, //DISPLAY_CTRL_MODE: continuous display.
{DC_CMD_STATE_CONTROL, GENERAL_UPDATE | WIN_A_UPDATE}, //General update; window A update.
{DC_CMD_STATE_CONTROL, GENERAL_ACT_REQ | WIN_A_ACT_REQ} //General activation request; window A activation request.

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018-2019 CTCaer
* Copyright (c) 2018-2019 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -189,7 +189,7 @@ void gfx_putc(char c)
u8 *cbuf = (u8 *)&_gfx_font[8 * (c - 32)];
u32 *fb = gfx_ctxt.fb + gfx_con.x + gfx_con.y * gfx_ctxt.stride;
for (u32 i = 0; i < 16; i+=2)
for (u32 i = 0; i < 16; i += 2)
{
u8 v = *cbuf++;
for (u32 k = 0; k < 2; k++)
@@ -258,7 +258,6 @@ void gfx_putc(char c)
}
break;
}
}
void gfx_puts(const char *s)
@@ -596,7 +595,7 @@ __attribute__((target("arm"))) void gfx_set_rect_land_block(const u32 *buf, u32
GOB_address = (y >> 7) * image_width_in_gobs + ((x >> 4) << 13) + (((y % 128) >> 3) << 9);
x2 = x << 2;
addr = GOB_address
addr = GOB_address
+ (((x2 % 64) >> 5) << 8)
+ (((y % 8) >> 1) << 6)
+ (((x2 % 32) >> 4) << 5)
@@ -616,7 +615,7 @@ __attribute__((target("arm"))) void gfx_set_rect_land_block(const u32 *buf, u32
// GOB_address = (y / (8 * block_height)) * image_width_in_gobs + ((x * 4 / 64) * 512 * block_height) + ((y % (8 * block_height) / 8) * 512);
// x2 = x << 2;
// addr = GOB_address
// addr = GOB_address
// + (((x2 % 64) >> 5) << 8)
// + (((y % 8) >> 1) << 6)
// + (((x2 % 32) >> 4) << 5)

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018-2019 CTCaer
* Copyright (C) 2018 M4xw
* Copyright (c) 2018-2019 CTCaer
* Copyright (c) 2018 M4xw
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -82,13 +82,13 @@ static const u8 console_keyseed[0x10] =
const u8 package2_keyseed[] =
{ 0xFB, 0x8B, 0x6A, 0x9C, 0x79, 0x00, 0xC8, 0x49, 0xEF, 0xD2, 0x4D, 0x85, 0x4D, 0x30, 0xA0, 0xC7 };
static const u8 master_keyseed_4xx_5xx_610[0x10] =
static const u8 master_keyseed_4xx_5xx_610[0x10] =
{ 0x2D, 0xC1, 0xF4, 0x8D, 0xF3, 0x5B, 0x69, 0x33, 0x42, 0x10, 0xAC, 0x65, 0xDA, 0x90, 0x46, 0x66 };
static const u8 master_keyseed_620[0x10] =
{ 0x37, 0x4B, 0x77, 0x29, 0x59, 0xB4, 0x04, 0x30, 0x81, 0xF6, 0xE5, 0x8C, 0x6D, 0x36, 0x17, 0x9A };
static const u8 console_keyseed_4xx_5xx[0x10] =
static const u8 console_keyseed_4xx_5xx[0x10] =
{ 0x0C, 0x91, 0x09, 0xDB, 0x93, 0x93, 0x07, 0x81, 0x07, 0x3C, 0xC4, 0x16, 0x22, 0x7C, 0x6C, 0x28 };
int keygen(u8 *keyblob, u32 kb, tsec_ctxt_t *tsec_ctxt)

View File

@@ -91,7 +91,7 @@ pkg2_hdr_t *pkg2_decrypt(void *data, u8 kb)
pkg2_hdr_t mkey_test;
u8 *pdata = (u8 *)data;
u8 keyslot = 8;
// Skip signature.
pdata += 0x100;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018-2019 CTCaer
* Copyright (c) 2018-2019 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -44,7 +44,7 @@ u8 warmboot_reboot[] = {
0x14, 0x00, 0x9F, 0xE5, // LDR R0, =0x7000E450
0x01, 0x10, 0xB0, 0xE3, // MOVS R1, #1
0x00, 0x10, 0x80, 0xE5, // STR R1, [R0]
0x0C, 0x00, 0x9F, 0xE5, // LDR R0, =0x7000E400
0x0C, 0x00, 0x9F, 0xE5, // LDR R0, =0x7000E400
0x10, 0x10, 0xB0, 0xE3, // MOVS R1, #0x10
0x00, 0x10, 0x80, 0xE5, // STR R1, [R0]
0xFE, 0xFF, 0xFF, 0xEA, // LOOP
@@ -80,7 +80,7 @@ void check_sept()
f_unlink("sept/payload.bin");
f_rename("sept/payload.bak", "sept/payload.bin");
}
return;
}
@@ -129,7 +129,7 @@ int reboot_to_sept(const u8 *tsec_fw, u32 kb)
memcpy((u8 *)(SEPT_PK1T_ADDR - WB_RST_SIZE), (u8 *)warmboot_reboot, sizeof(warmboot_reboot));
memcpy((void *)SEPT_PK1T_ADDR, tsec_fw, tsec_fw_size);
*(vu32 *)SEPT_TCSZ_ADDR = tsec_fw_size;
// Copy sept-primary.
if (f_open(&fp, "sept/sept-primary.bin", FA_READ))
goto error;

View File

@@ -64,7 +64,6 @@ void get_als_lux(als_table_t *als_val)
data[1] = i2c_recv_byte(I2C_2, BH1730_I2C_ADDR, BH1730_ADDR(BH1730_DATA1LOW_REG)) +
(i2c_recv_byte(I2C_2, BH1730_I2C_ADDR, BH1730_ADDR(BH1730_DATA1HIGH_REG)) << 8);
als_val->over_limit = data[0] > 65534 || data[1] > 65534;
als_val->vi_light = data[0];
als_val->ir_light = data[1];

View File

@@ -38,7 +38,7 @@ static int touch_command(u8 cmd)
int err = i2c_send_byte(I2C_3, STMFTS_I2C_ADDR, cmd, 0);
if (!err)
return 1;
// TODO: Check for completion in event loop
msleep(1);
return 0;
@@ -60,11 +60,11 @@ static void _touch_process_contact_event(touch_event *event, bool touching)
event->fingers = 0;
}
static void _touch_parse_event(touch_event *event)
static void _touch_parse_event(touch_event *event)
{
event->type = event->raw[1] & STMFTS_MASK_EVENT_ID;
switch (event->type)
switch (event->type)
{
case STMFTS_EV_MULTI_TOUCH_ENTER:
case STMFTS_EV_MULTI_TOUCH_MOTION:
@@ -108,7 +108,7 @@ void touch_poll(touch_event *event)
touch_event touch_poll_wait()
{
touch_event event;
do
do
{
touch_poll(&event);
} while (event.type != STMFTS_EV_MULTI_TOUCH_LEAVE);
@@ -160,7 +160,7 @@ int touch_power_on()
// Enables LDO6 for touchscreen VDD/AVDD supply
max77620_regulator_set_volt_and_flags(REGULATOR_LDO6, 2900000, MAX77620_POWER_MODE_NORMAL);
i2c_send_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_LDO6_CFG2,
MAX77620_LDO_CFG2_ADE_ENABLE | (3 << 3) | (MAX77620_POWER_MODE_NORMAL << MAX77620_LDO_POWER_MODE_SHIFT));
MAX77620_LDO_CFG2_ADE_ENABLE | (3 << 3) | (MAX77620_POWER_MODE_NORMAL << MAX77620_LDO_POWER_MODE_SHIFT));
msleep(20);
@@ -189,7 +189,7 @@ int touch_power_on()
return 1;
}
void touch_power_off()
void touch_power_off()
{
touch_command(STMFTS_SLEEP_IN);

View File

@@ -33,24 +33,24 @@ const blz_footer *blz_get_footer(const unsigned char *compData, unsigned int com
}
// From https://github.com/SciresM/hactool/blob/master/kip.c which is exactly how kernel does it, thanks SciresM!
int blz_uncompress_inplace(unsigned char *dataBuf, unsigned int compSize, const blz_footer *footer)
int blz_uncompress_inplace(unsigned char *dataBuf, unsigned int compSize, const blz_footer *footer)
{
u32 addl_size = footer->addl_size;
u32 header_size = footer->header_size;
u32 cmp_and_hdr_size = footer->cmp_and_hdr_size;
unsigned char* cmp_start = &dataBuf[compSize] - cmp_and_hdr_size;
u32 cmp_ofs = cmp_and_hdr_size - header_size;
u32 out_ofs = cmp_and_hdr_size + addl_size;
while (out_ofs)
while (out_ofs)
{
unsigned char control = cmp_start[--cmp_ofs];
for (unsigned int i=0; i<8; i++)
for (unsigned int i=0; i<8; i++)
{
if (control & 0x80)
if (control & 0x80)
{
if (cmp_ofs < 2)
if (cmp_ofs < 2)
return 0; // Out of bounds.
cmp_ofs -= 2;
@@ -65,17 +65,17 @@ int blz_uncompress_inplace(unsigned char *dataBuf, unsigned int compSize, const
for (unsigned int j = 0; j < seg_size; j++)
cmp_start[out_ofs + j] = cmp_start[out_ofs + j + seg_ofs];
}
else
else
{
// Copy directly.
if (cmp_ofs < 1)
if (cmp_ofs < 1)
return 0; //out of bounds
cmp_start[--out_ofs] = cmp_start[--cmp_ofs];
}
control <<= 1;
if (out_ofs == 0) // Blz works backwards, so if it reaches byte 0, it's done.
return 1;
return 1;
}
}

View File

@@ -14,7 +14,7 @@
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <string.h>
#include "elfload.h"

View File

@@ -75,7 +75,7 @@ typedef struct el_ctx
// Section Header Str Table
Elf_Shdr shstr;
Elf_Shdr symtab;
/* Offset of dynamic table (0 if not ET_DYN) */
Elf_Off dynoff;
/* Size of dynamic table (0 if not ET_DYN) */

View File

@@ -3953,7 +3953,7 @@ FRESULT f_read_fast (
else if (clst == 0xFFFFFFFF) { EFSPRINTF("DSKC"); ABORT(fs, FR_DISK_ERR); }
fp->clust = clst; /* Set working cluster */
sector_base = clst2sect(fs, fp->clust);
count += fs->csize;
btr -= csize_bytes;
@@ -4182,7 +4182,7 @@ FRESULT f_write_fast (
else if (clst == 0xFFFFFFFF) { EFSPRINTF("DERR"); ABORT(fs, FR_DISK_ERR); }
fp->clust = clst; /* Set working cluster */
sector_base = clst2sect(fs, fp->clust);
count += fs->csize;
btw -= csize_bytes;

View File

@@ -67,7 +67,7 @@ void lv_init(void)
/* Do nothing if already initialized */
if (_lv_initialized)
return;
LV_GC_ROOT(_lv_def_scr) = NULL;
LV_GC_ROOT(_lv_act_scr) = NULL;
LV_GC_ROOT(_lv_top_layer) = NULL;
@@ -1938,8 +1938,8 @@ static void delete_children(lv_obj_t * obj)
lv_obj_t * i_next;
i = lv_ll_get_head(&(obj->child_ll));
/*Remove from the group; remove before transversing children so that
* the object still has access to all children during the
/*Remove from the group; remove before transversing children so that
* the object still has access to all children during the
* LV_SIGNAL_DEFOCUS call*/
#if USE_LV_GROUP
if(obj->group_p != NULL) lv_group_remove_obj(obj);

View File

@@ -24,7 +24,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t hekate_symbol_120_glyph_dsc[] =
static const lv_font_glyph_dsc_t hekate_symbol_120_glyph_dsc[] =
{
#if USE_HEKATE_SYMBOL_120 == 8
{.w_px = 103, .glyph_index = 0}, /*Unicode: U+f002 ()*/
@@ -35,7 +35,7 @@ static const lv_font_glyph_dsc_t hekate_symbol_120_glyph_dsc[] =
#endif
};
lv_font_t hekate_symbol_120 =
lv_font_t hekate_symbol_120 =
{
.unicode_first = LV_SYMBOL_GLYPH_FIRST, /*First Unicode letter in this font*/
.unicode_last = LV_SYMBOL_GLYPH_LAST, /*Last Unicode letter in this font*/

View File

@@ -24,7 +24,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t hekate_symbol_20_glyph_dsc[] =
static const lv_font_glyph_dsc_t hekate_symbol_20_glyph_dsc[] =
{
#if USE_HEKATE_SYMBOL_20 == 4
{.w_px = 5, .glyph_index = 0}, /*Unicode: U+f001 ()*/
@@ -133,7 +133,7 @@ static const lv_font_glyph_dsc_t hekate_symbol_20_glyph_dsc[] =
#endif
};
lv_font_t hekate_symbol_20 =
lv_font_t hekate_symbol_20 =
{
.unicode_first = LV_SYMBOL_GLYPH_FIRST, /*First Unicode letter in this font*/
.unicode_last = LV_SYMBOL_GLYPH_LAST, /*Last Unicode letter in this font*/

View File

@@ -24,7 +24,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t hekate_symbol_30_glyph_dsc[] =
static const lv_font_glyph_dsc_t hekate_symbol_30_glyph_dsc[] =
{
#if USE_HEKATE_SYMBOL_30 == 4
{.w_px = 7, .glyph_index = 0}, /*Unicode: U+f001 ()*/
@@ -133,7 +133,7 @@ static const lv_font_glyph_dsc_t hekate_symbol_30_glyph_dsc[] =
#endif
};
lv_font_t hekate_symbol_30 =
lv_font_t hekate_symbol_30 =
{
.unicode_first = LV_SYMBOL_GLYPH_FIRST, /*First Unicode letter in this font*/
.unicode_last = LV_SYMBOL_GLYPH_LAST, /*Last Unicode letter in this font*/

View File

@@ -23,7 +23,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t interui_20_glyph_dsc[] =
static const lv_font_glyph_dsc_t interui_20_glyph_dsc[] =
{
#if USE_INTERUI_20 == 4
{.w_px = 6, .glyph_index = 0}, /*Unicode: U+0020 ( )*/
@@ -222,7 +222,7 @@ static const lv_font_glyph_dsc_t interui_20_glyph_dsc[] =
#endif
};
lv_font_t interui_20 =
lv_font_t interui_20 =
{
.unicode_first = 32, /*First Unicode letter in this font*/
.unicode_last = 126, /*Last Unicode letter in this font*/

View File

@@ -23,7 +23,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t interui_30_glyph_dsc[] =
static const lv_font_glyph_dsc_t interui_30_glyph_dsc[] =
{
#if USE_INTERUI_30 == 4
{.w_px = 8, .glyph_index = 0}, /*Unicode: U+0020 ( )*/
@@ -222,7 +222,7 @@ static const lv_font_glyph_dsc_t interui_30_glyph_dsc[] =
#endif
};
lv_font_t interui_30 =
lv_font_t interui_30 =
{
.unicode_first = 32, /*First Unicode letter in this font*/
.unicode_last = 126, /*Last Unicode letter in this font*/

View File

@@ -23,7 +23,7 @@
***********************************************************************************/
/*Store the glyph descriptions*/
static const lv_font_glyph_dsc_t ubuntu_mono_glyph_dsc[] =
static const lv_font_glyph_dsc_t ubuntu_mono_glyph_dsc[] =
{
#if USE_UBUNTU_MONO == 4
{.w_px = 6, .glyph_index = 0}, /*Unicode: U+0020 ( )*/
@@ -222,7 +222,7 @@ static const lv_font_glyph_dsc_t ubuntu_mono_glyph_dsc[] =
#endif
};
lv_font_t ubuntu_mono =
lv_font_t ubuntu_mono =
{
.unicode_first = 32, /*First Unicode letter in this font*/
.unicode_last = 126, /*Last Unicode letter in this font*/

View File

@@ -25,7 +25,7 @@
* STATIC VARIABLES
**********************/
#if (!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0
LV_ROOTS
LV_ROOTS
#endif /* LV_ENABLE_GC */
/**********************
* MACROS

View File

@@ -41,15 +41,14 @@ extern "C" {
prefix void * _lv_task_act;\
prefix void * _lv_indev_list;\
prefix void * _lv_disp_list;\
#define LV_NO_PREFIX
#define LV_ROOTS LV_GC_ROOTS(LV_NO_PREFIX)
#if LV_ENABLE_GC == 1
# if LV_MEM_CUSTOM != 1
# error "GC requires CUSTOM_MEM"
# endif /* LV_MEM_CUSTOM */
# endif /* LV_MEM_CUSTOM */
#else /* LV_ENABLE_GC */
# define LV_GC_ROOT(x) x
LV_GC_ROOTS(extern)

View File

@@ -189,9 +189,9 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
} else { /*Check the actual length*/
n_char_since_last_break++;
letter_width = lv_font_get_width(font, letter);
cur_w += letter_width;
cur_w += letter_width;
/* Get the length of the current work and determine best place
/* Get the length of the current work and determine best place
* to break the line. */
if(cur_w > max_width) {
if( last_break != NO_BREAK_FOUND ) {
@@ -231,7 +231,7 @@ uint16_t lv_txt_get_next_line(const char * txt, const lv_font_t * font,
}
other = false;
break;
}
}
n_char_since_last_break++;
lv_coord_t letter_width2 = lv_font_get_width(font, letter);
cur_w += letter_width2;

View File

@@ -801,7 +801,7 @@ static void draw_days(lv_obj_t * calendar, const lv_area_t * mask)
lv_area_t label_area;
lv_opa_t opa_scale = lv_obj_get_opa_scale(calendar);
label_area.y1 = calendar->coords.y1 + get_header_height(calendar) +
ext->style_day_names->body.padding.ver + lv_font_get_height(ext->style_day_names->text.font) +
ext->style_day_names->body.padding.ver + lv_font_get_height(ext->style_day_names->text.font) +
ext->style_day_names->body.padding.ver;
label_area.y2 = label_area.y1 + lv_font_get_height(style_bg->text.font);

View File

@@ -429,10 +429,10 @@ void lv_canvas_draw_line(lv_obj_t * canvas, lv_point_t point1, lv_point_t point2
y1 = point2.y;
int dx = abs(x1-x0), sx = x0<x1 ? 1 : -1;
int dy = abs(y1-y0), sy = y0<y1 ? 1 : -1;
int dy = abs(y1-y0), sy = y0<y1 ? 1 : -1;
int err = (dx>dy ? dx : -dy)/2, e2;
for(;;){
for(;;){
lv_canvas_set_px(canvas, x0, y0, color);
if (x0==x1 && y0==y1) break;
@@ -449,7 +449,7 @@ void lv_canvas_draw_line(lv_obj_t * canvas, lv_point_t point1, lv_point_t point2
* @param color line color of the triangle
*/
void lv_canvas_draw_triangle(lv_obj_t * canvas, lv_point_t * points, lv_color_t color)
{
{
lv_canvas_draw_polygon(canvas, points, 3, color);
}
@@ -460,7 +460,7 @@ void lv_canvas_draw_triangle(lv_obj_t * canvas, lv_point_t * points, lv_color_t
* @param color line color of the rectangle
*/
void lv_canvas_draw_rect(lv_obj_t * canvas, lv_point_t * points, lv_color_t color)
{
{
lv_canvas_draw_polygon(canvas, points, 4, color);
}
@@ -472,7 +472,7 @@ void lv_canvas_draw_rect(lv_obj_t * canvas, lv_point_t * points, lv_color_t colo
* @param color line color of the polygon
*/
void lv_canvas_draw_polygon(lv_obj_t * canvas, lv_point_t * points, size_t size, lv_color_t color)
{
{
uint8_t i;
for(i=0; i < (size - 1); i++) {
@@ -512,7 +512,7 @@ void lv_canvas_fill_polygon(lv_obj_t * canvas, lv_point_t * points, size_t size,
* @param x x coordinate of the start position (seed)
* @param y y coordinate of the start position (seed)
* @param boundary_color edge/boundary color of the area
* @param fill_color fill color of the area
* @param fill_color fill color of the area
*/
void lv_canvas_boundary_fill4(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_color_t boundary_color, lv_color_t fill_color)
{

View File

@@ -202,7 +202,7 @@ void lv_canvas_fill_polygon(lv_obj_t * canvas, lv_point_t * points, size_t size,
* @param x x coordinate of the start position (seed)
* @param y y coordinate of the start position (seed)
* @param boundary_color edge/boundary color of the area
* @param fill_color fill color of the area
* @param fill_color fill color of the area
*/
void lv_canvas_boundary_fill4(lv_obj_t * canvas, lv_coord_t x, lv_coord_t y, lv_color_t boundary_color, lv_color_t fill_color);

View File

@@ -606,7 +606,7 @@ static bool lv_ddlist_design(lv_obj_t * ddlist, const lv_area_t * mask, lv_desig
/*Add a down symbol in ddlist when closed*/
else
{
{
/*Draw a arrow in ddlist if enabled*/
if(ext->draw_arrow)
{

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file lv_ddlist.h
*

View File

@@ -101,7 +101,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
lv_list_ext_t * ext = lv_obj_allocate_ext_attr(new_list, sizeof(lv_list_ext_t));
lv_mem_assert(ext);
if(ext == NULL) return NULL;
// Important!
static lv_style_t img_btn_color;
lv_style_copy( &img_btn_color, &lv_style_plain);
@@ -116,7 +116,7 @@ lv_obj_t * lv_list_create(lv_obj_t * par, const lv_obj_t * copy)
ext->anim_time = LV_LIST_FOCUS_TIME;
ext->single_mode = false;
ext->size = 0;
#if USE_LV_GROUP
ext->last_sel = NULL;
ext->selected_btn = NULL;

View File

@@ -121,14 +121,14 @@ bool lv_list_remove(const lv_obj_t * list, uint32_t index);
/*=====================
* Setter functions
*====================*/
/**
* Set single button selected mode, only one button will be selected if enabled.
* @param list pointer to the currently pressed list object
* @param mode, enable(true)/disable(false) single selected mode.
*/
void lv_list_set_single_mode(lv_obj_t *list, bool mode);
#if USE_LV_GROUP
/**
@@ -193,7 +193,7 @@ void lv_list_set_style(lv_obj_t *list, lv_list_style_t type, lv_style_t *style);
* @param list pointer to the currently pressed list object.
*/
bool lv_list_get_single_mode(lv_obj_t *list);
/**
* Get the text of a list element
* @param btn pointer to list element

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file lv_page.h
*

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file lv_win.c
*

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
*@file lv_themes.h
*

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@
#include "../utils/types.h"
typedef struct
typedef struct
{
s32 pll_osc_in;
s32 pll_out;
@@ -257,7 +257,7 @@ typedef struct
} burst_regs_t;
typedef struct
typedef struct
{
u32 burst_regs[221];
u32 burst_reg_per_ch[8];
@@ -266,7 +266,7 @@ typedef struct
u32 shadow_regs_rdwr_train[221];
} burst_regs_table_t;
typedef struct
typedef struct
{
u32 ptfv_dqsosc_movavg_c0d0u0_idx;
u32 ptfv_dqsosc_movavg_c0d0u1_idx;

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved.
* Copyright 2014 Google Inc.
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -74,7 +74,7 @@ bool get_sd_card_removed()
{
if (sd_init_done && !!gpio_read(GPIO_PORT_Z, GPIO_PIN_1))
return true;
return false;
}
@@ -248,7 +248,7 @@ lv_res_t launch_payload(lv_obj_t *list)
goto out;
char path[128];
strcpy(path,"bootloader/payloads/");
strcat(path, filename);
@@ -378,7 +378,7 @@ void nyx_init_load_res()
minerva_change_freq(FREQ_1600);
load_saved_configuration();
FIL fp;
f_open(&fp, "bootloader/sys/res.pak", FA_READ);
f_read(&fp, (void *)NYX_RES_ADDR, f_size(&fp), NULL);

View File

@@ -1,7 +1,7 @@
/*
* Battery charger driver for Nintendo Switch's TI BQ24193
*
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -91,7 +91,7 @@ int bq24193_get_property(enum BQ24193_reg_prop prop, int *value)
break;
case BQ24193_ChargeVoltageLimit: // Charge voltage limit (mV).
data = i2c_recv_byte(I2C_1, BQ24193_I2C_ADDR, BQ24193_ChrgVolt);
data = (data & BQ24193_CHRGVOLT_VREG) >> 2;
data = (data & BQ24193_CHRGVOLT_VREG) >> 2;
*value += ((data >> 0) & 1) ? 16 : 0;
*value += ((data >> 1) & 1) ? 32 : 0;
*value += ((data >> 2) & 1) ? 64 : 0;

View File

@@ -1,7 +1,7 @@
/*
* Battery charger driver for Nintendo Switch's TI BQ24193
*
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,9 +1,9 @@
/*
* Fuel gauge driver for Nintendo Switch's Maxim 17050
*
* Copyright (C) 2011 Samsung Electronics
* Copyright (c) 2011 Samsung Electronics
* MyungJoo Ham <myungjoo.ham@samsung.com>
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -262,7 +262,7 @@ int max17050_fix_configuration()
/* Init complete, Clear the POR bit */
//_max17050_set_por_bit(0); // Should we? Or let the switch to reconfigure POR?
// Sets POR, BI, BR.
// Sets POR, BI, BR.
_max17050_set_por_bit(0x8801);
return 0;

View File

@@ -2,9 +2,9 @@
* Fuel gauge driver for Nintendo Switch's Maxim 17050
* Note that Maxim 8966 and 8997 are mfd and this is its subdevice.
*
* Copyright (C) 2011 Samsung Electronics
* Copyright (c) 2011 Samsung Electronics
* MyungJoo Ham <myungjoo.ham@samsung.com>
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,7 +1,7 @@
/*
* Defining registers address and its bit definitions of MAX77620 and MAX20024
*
* Copyright (C) 2016 NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016 NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019 CTCaer
*
* This program is free software; you can redistribute it and/or modify it

View File

@@ -36,7 +36,7 @@ void max77620_rtc_get_time(rtc_time_t *time)
time->min = i2c_recv_byte(I2C_5, MAX77620_RTC_I2C_ADDR, MAX77620_RTC_MIN_REG) & 0x7F;
time->hour = i2c_recv_byte(I2C_5, MAX77620_RTC_I2C_ADDR, MAX77620_RTC_HOUR_REG) & 0x1F;
if (!(val & MAX77620_RTC_24H) && time->hour & MAX77620_RTC_HOUR_PM_MASK)
time->hour = (time->hour & 0xF) + 12;

View File

@@ -209,6 +209,7 @@
#define SE_INT_OP_DONE(x) (x << SE_INT_OP_DONE_SHIFT)
#define SE_INT_ERROR_SHIFT 16
#define SE_INT_ERROR(x) (x << SE_INT_ERROR_SHIFT)
#define SE_STATUS_0 0x800
#define SE_ERR_STATUS_0 0x804
@@ -254,7 +255,7 @@
TEGRA_SE_RNG_DT_SIZE)
#define TEGRA_SE_AES_CMAC_DIGEST_SIZE 16
#define TEGRA_SE_RSA512_DIGEST_SIZE 64
#define TEGRA_SE_RSA512_DIGEST_SIZE 64
#define TEGRA_SE_RSA1024_DIGEST_SIZE 128
#define TEGRA_SE_RSA1536_DIGEST_SIZE 192
#define TEGRA_SE_RSA2048_DIGEST_SIZE 256

View File

@@ -155,7 +155,7 @@ int tsec_query(u8 *tsec_keys, u8 kb, tsec_ctxt_t *tsec_ctxt)
se = page_alloc(1);
memcpy(se, (void *)SE_BASE, 0x1000);
smmu_map(pdir, SE_BASE, (u32)se, 1, _READABLE | _WRITABLE | _NONSECURE);
// Memory controller.
mc = page_alloc(1);
memcpy(mc, (void *)MC_BASE, 0x1000);
@@ -217,7 +217,7 @@ int tsec_query(u8 *tsec_keys, u8 kb, tsec_ctxt_t *tsec_ctxt)
memcpy(tsec_keys, &key, 0x20);
memcpy(tsec_ctxt->pkg1, iram, 0x30000);
smmu_deinit_for_tsec();
// for (int i = 0; i < kidx; i++)

View File

@@ -221,10 +221,10 @@ int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value))
{
break;
}
for (u32 i = 0; i < word_count; i++)
words[i] = fuse_read(word_addr--);
word0 = words[0];
if (_patch_hash_multi(words, word_count) >= 2)
{
@@ -238,7 +238,7 @@ int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value))
u32 word = words[i + 1];
u32 addr = (word >> 16) * 2;
u32 data = word & 0xFFFF;
ipatch(addr, data);
}
}
@@ -251,7 +251,7 @@ int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value))
}
word_count = word0 >> 25;
}
return 0;
}
@@ -278,10 +278,10 @@ int fuse_read_evp_thunk(u32 *iram_evp_thunks, u32 *iram_evp_thunks_len)
{
break;
}
for (u32 i = 0; i < word_count; i++)
words[i] = fuse_read(word_addr--);
word0 = words[0];
if (_patch_hash_multi(words, word_count) >= 2)
{
@@ -317,7 +317,7 @@ int fuse_read_evp_thunk(u32 *iram_evp_thunks, u32 *iram_evp_thunks_len)
}
word_count = word0 >> 25;
}
return 0;
}
@@ -334,7 +334,7 @@ bool fuse_check_patched_rcm()
while (word_count)
{
u32 word0 = fuse_read(word_addr);
u32 ipatch_count = (word0 >> 16) & 0xF;
u32 ipatch_count = (word0 >> 16) & 0xF;
for (u32 i = 0; i < ipatch_count; i++)
{

View File

@@ -30,7 +30,6 @@
extern sdmmc_t sd_sdmmc;
void reconfig_hw_workaround(bool extra_reconfig, u32 magic)
{
// Flush and disable MMU.

View File

@@ -97,7 +97,7 @@
#define PINMUX_OPEN_DRAIN (1 << 11)
#define PINMUX_SCHMT (1 << 12)
#define PINMUX_DRIVE_1X (0 << 13)
#define PINMUX_DRIVE_1X (0 << 13)
#define PINMUX_DRIVE_2X (1 << 13)
#define PINMUX_DRIVE_3X (2 << 13)
#define PINMUX_DRIVE_4X (3 << 13)

View File

@@ -156,7 +156,7 @@
#define SYSCTR0_COUNTERID7 0xFDC
#define SYSCTR0_COUNTERID8 0xFF0
#define SYSCTR0_COUNTERID9 0xFF4
#define SYSCTR0_COUNTERID10 0xFF8
#define SYSCTR0_COUNTERID10 0xFF8
#define SYSCTR0_COUNTERID11 0xFFC
/*! TMR registers. */

View File

@@ -35,7 +35,7 @@ void uart_init(u32 idx, u32 baud)
uart->UART_LCR = UART_LCR_DLAB | UART_LCR_WORD_LENGTH_8; // Enable DLAB & set 8n1 mode.
uart->UART_THR_DLAB = (u8)rate; // Divisor latch LSB.
uart->UART_IER_DLAB = (u8)(rate >> 8); // Divisor latch MSB.
uart->UART_LCR = UART_LCR_WORD_LENGTH_8; // Diable DLAB.
uart->UART_LCR = UART_LCR_WORD_LENGTH_8; // Disable DLAB.
// Setup and flush fifo.
uart->UART_IIR_FCR = UART_IIR_FCR_EN_FIFO | UART_IIR_FCR_RX_CLR | UART_IIR_FCR_TX_CLR;

View File

@@ -1,8 +1,8 @@
/*
* include/linux/mmc/sd.h
*
* Copyright (C) 2005-2007 Pierre Ossman, All Rights Reserved.
* Copyright (C) 2018 CTCaer
* Copyright (c) 2005-2007 Pierre Ossman, All Rights Reserved.
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018-2019 CTCaer
* Copyright (c) 2018-2019 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -1067,7 +1067,7 @@ void sdmmc_storage_init_wait_sd()
int sdmmc_storage_init_sd(sdmmc_storage_t *storage, sdmmc_t *sdmmc, u32 id, u32 bus_width, u32 type)
{
int is_version_1 = 0;
// Some cards (Sandisk U1), do not like a fast power cycle. Wait min 100ms.
sdmmc_storage_init_wait_sd();

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -722,7 +722,7 @@ static int _sdmmc_check_mask_interrupt(sdmmc_t *sdmmc, u16 *pout, u16 mask)
sdmmc->regs->norintsts = norintsts & mask;
return SDMMC_MASKINT_MASKED;
}
return SDMMC_MASKINT_NOERROR;
}
@@ -767,7 +767,7 @@ static int _sdmmc_stop_transmission_inner(sdmmc_t *sdmmc, u32 *rsp)
if (!res)
return 0;
_sdmmc_cache_rsp(sdmmc, rsp, 4, SDMMC_RSP_TYPE_1);
return _sdmmc_wait_prnsts_type1(sdmmc);
@@ -901,7 +901,7 @@ static int _sdmmc_execute_cmd_inner(sdmmc_t *sdmmc, sdmmc_cmd_t *cmd, sdmmc_req_
_sdmmc_parse_cmdbuf(sdmmc, cmd, is_data_present);
int res = _sdmmc_wait_request(sdmmc);
DPRINTF("rsp(%d): %08X, %08X, %08X, %08X\n", res,
DPRINTF("rsp(%d): %08X, %08X, %08X, %08X\n", res,
sdmmc->regs->rspreg0, sdmmc->regs->rspreg1, sdmmc->regs->rspreg2, sdmmc->regs->rspreg3);
if (res)
{
@@ -943,7 +943,7 @@ static int _sdmmc_config_sdmmc1()
gpio_output_enable(GPIO_PORT_Z, GPIO_PIN_1, GPIO_OUTPUT_DISABLE);
usleep(100);
// Check if SD card is inserted.
// Check if SD card is inserted.
if(!!gpio_read(GPIO_PORT_Z, GPIO_PIN_1))
return 0;
@@ -1055,7 +1055,7 @@ void sdmmc_end(sdmmc_t *sdmmc)
if (!sdmmc->clock_stopped)
{
_sdmmc_sd_clock_disable(sdmmc);
// Disable SDMMC power.
// Disable SDMMC power.
_sdmmc_set_voltage(sdmmc, SDMMC_POWER_OFF);
// Disable SD card power.
@@ -1134,7 +1134,7 @@ int sdmmc_enable_low_voltage(sdmmc_t *sdmmc)
_sdmmc_set_voltage(sdmmc, SDMMC_POWER_1_8);
_sdmmc_get_clkcon(sdmmc);
msleep(5);
if (sdmmc->regs->hostctl2 & SDHCI_CTRL_VDD_180)
{
sdmmc->regs->clkcon |= TEGRA_MMC_CLKCON_SD_CLOCK_ENABLE;

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,

View File

@@ -29,7 +29,7 @@ char *dirlist(const char *directory, const char *pattern, bool includeHiddenFile
u32 i = 0, j = 0, k = 0;
DIR dir;
FILINFO fno;
char *dir_entries = (char *)calloc(max_entries, 256);
char *temp = (char *)calloc(1, 256);
@@ -85,7 +85,7 @@ char *dirlist(const char *directory, const char *pattern, bool includeHiddenFile
{
for (j = i + 1; j < k; j++)
{
if (strcmp(&dir_entries[i * 256], &dir_entries[j * 256]) > 0)
if (strcmp(&dir_entries[i * 256], &dir_entries[j * 256]) > 0)
{
memcpy(temp, &dir_entries[i * 256], strlen(&dir_entries[i * 256]) + 1);
memcpy(&dir_entries[i * 256], &dir_entries[j * 256], strlen(&dir_entries[j * 256]) + 1);

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -87,7 +87,7 @@ void panic(u32 val)
TMR(TIMER_TMR9_TMR_PTV) = TIMER_EN | TIMER_PER_EN;
TMR(TIMER_WDT4_CONFIG) = TIMER_SRC(9) | TIMER_PER(1) | TIMER_PMCRESET_EN;
TMR(TIMER_WDT4_COMMAND) = TIMER_START_CNT;
while (true)
usleep(1);
}

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2018 naehrwert
* Copyright (C) 2018 CTCaer
* Copyright (c) 2018 CTCaer
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,