From 7c42f72b8af1f9e9693818130fe6a26c32725ad1 Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Fri, 18 Oct 2019 18:02:06 +0300 Subject: [PATCH] refactor: Remove all unwanted whitespace --- README_BOOTLOGO.md | 2 +- bootloader/config/config.c | 2 +- bootloader/config/ini.c | 2 +- bootloader/config/ini.h | 2 +- bootloader/frontend/fe_emmc_tools.c | 8 +- bootloader/frontend/fe_info.c | 17 +- bootloader/frontend/fe_tools.c | 14 +- bootloader/gfx/di.c | 1 + bootloader/gfx/di.h | 2 +- bootloader/gfx/di.inl | 4 +- bootloader/gfx/gfx.c | 5 +- bootloader/gfx/gfx.h | 4 +- bootloader/gfx/logos.h | 2 +- bootloader/gfx/tui.c | 2 +- bootloader/gfx/tui.h | 2 +- bootloader/hos/hos.c | 12 +- bootloader/hos/hos_config.c | 2 +- bootloader/hos/pkg2.c | 20 +- bootloader/hos/pkg2.h | 2 +- bootloader/hos/pkg2_ini_kippatch.c | 2 +- bootloader/hos/secmon_exo.h | 2 +- bootloader/hos/sept.c | 7 +- bootloader/libs/compr/blz.c | 20 +- bootloader/libs/elfload/elfload.c | 2 +- bootloader/libs/elfload/elfload.h | 2 +- bootloader/main.c | 10 +- bootloader/mem/mtc_table.h | 6 +- bootloader/mem/sdram_lp0_param_t210.h | 2 +- bootloader/power/bq24193.c | 4 +- bootloader/power/bq24193.h | 2 +- bootloader/power/max17050.c | 6 +- bootloader/power/max17050.h | 4 +- bootloader/power/max77620.h | 2 +- bootloader/rtc/max77620-rtc.c | 2 +- bootloader/sec/se_t210.h | 3 +- bootloader/sec/tsec.c | 4 +- bootloader/soc/fuse.c | 16 +- bootloader/soc/hw_init.c | 6 +- bootloader/soc/pinmux.h | 2 +- bootloader/soc/t210.h | 2 +- bootloader/soc/uart.c | 2 +- bootloader/storage/emummc.c | 6 +- bootloader/storage/emummc.h | 2 +- bootloader/storage/sd.h | 4 +- bootloader/storage/sdmmc.c | 4 +- bootloader/storage/sdmmc.h | 2 +- bootloader/storage/sdmmc_driver.c | 12 +- bootloader/utils/btn.c | 2 +- bootloader/utils/btn.h | 2 +- bootloader/utils/dirlist.c | 4 +- bootloader/utils/util.c | 4 +- bootloader/utils/util.h | 2 +- common/common_gfx.h | 6 +- common/common_module.h | 4 +- modules/hekate_libsys_lp0/Makefile | 2 +- .../hekate_libsys_lp0/sdram_lp0_param_t210.h | 2 +- modules/hekate_libsys_lp0/sys_sdramlp0.c | 4 +- modules/hekate_libsys_minerva/Makefile | 2 +- modules/hekate_libsys_minerva/README.md | 2 +- modules/hekate_libsys_minerva/mtc_table.h | 6 +- modules/hekate_libsys_minerva/sys_sdrammtc.c | 40 +- modules/simple_sample/Makefile | 2 +- modules/simple_sample/gfx/gfx.c | 3 +- modules/simple_sample/gfx/gfx.h | 4 +- nyx/nyx_gui/config/ini.c | 2 +- nyx/nyx_gui/config/ini.h | 2 +- nyx/nyx_gui/frontend/fe_emmc_tools.c | 16 +- nyx/nyx_gui/frontend/fe_emummc_tools.c | 12 +- nyx/nyx_gui/frontend/gui.c | 39 +- nyx/nyx_gui/frontend/gui_emmc_tools.c | 4 +- nyx/nyx_gui/frontend/gui_emummc_tools.c | 23 +- nyx/nyx_gui/frontend/gui_info.c | 22 +- nyx/nyx_gui/frontend/gui_options.c | 6 +- nyx/nyx_gui/frontend/gui_tools.c | 22 +- nyx/nyx_gui/gfx/di.c | 1 + nyx/nyx_gui/gfx/di.h | 2 +- nyx/nyx_gui/gfx/di.inl | 6 +- nyx/nyx_gui/gfx/gfx.c | 9 +- nyx/nyx_gui/gfx/gfx.h | 4 +- nyx/nyx_gui/hos/hos.c | 4 +- nyx/nyx_gui/hos/pkg2.c | 2 +- nyx/nyx_gui/hos/pkg2.h | 2 +- nyx/nyx_gui/hos/sept.c | 6 +- nyx/nyx_gui/input/als.c | 1 - nyx/nyx_gui/input/touch.c | 12 +- nyx/nyx_gui/libs/compr/blz.c | 20 +- nyx/nyx_gui/libs/elfload/elfload.c | 2 +- nyx/nyx_gui/libs/elfload/elfload.h | 2 +- nyx/nyx_gui/libs/fatfs/ff.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_core/lv_obj.c | 6 +- .../libs/lvgl/lv_fonts/hekate_symbol_120.c | 4 +- .../libs/lvgl/lv_fonts/hekate_symbol_20.c | 4 +- .../libs/lvgl/lv_fonts/hekate_symbol_30.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_fonts/interui_20.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_fonts/interui_30.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_fonts/ubuntu_mono.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.c | 2 +- nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.h | 5 +- nyx/nyx_gui/libs/lvgl/lv_misc/lv_txt.c | 6 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_calendar.c | 2 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.c | 14 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.h | 2 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.c | 2 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.h | 2 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.c | 4 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.h | 6 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_page.h | 2 +- nyx/nyx_gui/libs/lvgl/lv_objx/lv_win.c | 2 +- nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme.h | 2 +- .../libs/lvgl/lv_themes/lv_theme_hekate.c | 943 +++++++++--------- nyx/nyx_gui/mem/mtc_table.h | 6 +- nyx/nyx_gui/mem/sdram_lp0_param_t210.h | 2 +- nyx/nyx_gui/nyx.c | 6 +- nyx/nyx_gui/power/bq24193.c | 4 +- nyx/nyx_gui/power/bq24193.h | 2 +- nyx/nyx_gui/power/max17050.c | 6 +- nyx/nyx_gui/power/max17050.h | 4 +- nyx/nyx_gui/power/max77620.h | 2 +- nyx/nyx_gui/rtc/max77620-rtc.c | 2 +- nyx/nyx_gui/sec/se_t210.h | 3 +- nyx/nyx_gui/sec/tsec.c | 4 +- nyx/nyx_gui/soc/fuse.c | 16 +- nyx/nyx_gui/soc/hw_init.c | 1 - nyx/nyx_gui/soc/pinmux.h | 2 +- nyx/nyx_gui/soc/t210.h | 2 +- nyx/nyx_gui/soc/uart.c | 2 +- nyx/nyx_gui/storage/sd.h | 4 +- nyx/nyx_gui/storage/sdmmc.c | 4 +- nyx/nyx_gui/storage/sdmmc.h | 2 +- nyx/nyx_gui/storage/sdmmc_driver.c | 12 +- nyx/nyx_gui/utils/btn.c | 2 +- nyx/nyx_gui/utils/btn.h | 2 +- nyx/nyx_gui/utils/dirlist.c | 4 +- nyx/nyx_gui/utils/util.c | 4 +- nyx/nyx_gui/utils/util.h | 2 +- 135 files changed, 842 insertions(+), 841 deletions(-) diff --git a/README_BOOTLOGO.md b/README_BOOTLOGO.md index 2c60510..40d81f8 100644 --- a/README_BOOTLOGO.md +++ b/README_BOOTLOGO.md @@ -1,6 +1,6 @@ # hekate - Bootlogo -The bootlogo can be any size with a maximum of 720 x 1280. +The bootlogo can be any size with a maximum of 720 x 1280. When it's smaller than 720 x 1280, it is automatically centered and the background takes the color of the first pixel. diff --git a/bootloader/config/config.c b/bootloader/config/config.c index f9df696..8e1c674 100644 --- a/bootloader/config/config.c +++ b/bootloader/config/config.c @@ -526,7 +526,7 @@ void config_backlight() bri_text[i * 32] = ' '; else bri_text[i * 32] = '*'; - + if (i < 10) { bri_text[i * 32 + 1] = i + '0'; diff --git a/bootloader/config/ini.c b/bootloader/config/ini.c index f033994..1ae28e9 100644 --- a/bootloader/config/ini.c +++ b/bootloader/config/ini.c @@ -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, diff --git a/bootloader/config/ini.h b/bootloader/config/ini.h index 318adf0..dffbe86 100644 --- a/bootloader/config/ini.h +++ b/bootloader/config/ini.h @@ -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, diff --git a/bootloader/frontend/fe_emmc_tools.c b/bootloader/frontend/fe_emmc_tools.c index 34d8183..28e63e1 100644 --- a/bootloader/frontend/fe_emmc_tools.c +++ b/bootloader/frontend/fe_emmc_tools.c @@ -77,7 +77,7 @@ static int _dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFi 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. @@ -88,7 +88,7 @@ static int _dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFi gfx_con.fntsz = 16; EPRINTFARGS("\nFailed to read %d blocks (@LBA %08X),\nfrom eMMC!\n\nVerification failed..\n", num, lba_curr); - + f_close(&fp); return 1; } @@ -97,7 +97,7 @@ static int _dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFi { gfx_con.fntsz = 16; EPRINTFARGS("\nFailed to read %d blocks (@LBA %08X),\nfrom sd card!\n\nVerification failed..\n", num, lba_curr); - + f_close(&fp); return 1; } @@ -110,7 +110,7 @@ static int _dump_emmc_verify(sdmmc_storage_t *storage, u32 lba_curr, char *outFi { gfx_con.fntsz = 16; EPRINTFARGS("\nSD and eMMC data (@LBA %08X),\ndo not match!\n\nVerification failed..\n", lba_curr); - + f_close(&fp); return 1; } diff --git a/bootloader/frontend/fe_info.c b/bootloader/frontend/fe_info.c index a5fffba..c4bf99f 100644 --- a/bootloader/frontend/fe_info.c +++ b/bootloader/frontend/fe_info.c @@ -47,7 +47,7 @@ extern int sd_save_to_file(void *buf, u32 size, const char *filename); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); #pragma GCC push_options -#pragma GCC optimize ("Os") +#pragma GCC optimize ("Os") void print_fuseinfo() { @@ -419,7 +419,6 @@ void print_tsec_key() { for (u32 j = 0; j < 0x10; j++) gfx_printf("%02X", keys[j]); - if (pkg1_id->kb == KB_FIRMWARE_VERSION_620) { @@ -638,13 +637,13 @@ void bootrom_ipatches_info() gfx_con_setpos(0, 0); static const u32 BOOTROM_SIZE = 0x18000; - + u32 res = fuse_read_ipatch(_ipatch_process); if (res != 0) EPRINTFARGS("Failed to read ipatches. Error: %d", res); gfx_puts("\nPress POWER to dump them to SD Card.\nPress VOL to go to the menu.\n"); - + u32 btn = btn_wait(); if (btn & BTN_POWER) { @@ -662,21 +661,21 @@ void bootrom_ipatches_info() } else EPRINTFARGS("Failed to read evp_thunks. Error: %d", res); - + emmcsn_path_impl(path, "/dumps", "bootrom_patched.bin", NULL); if (!sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path)) gfx_puts("\nbootrom_patched.bin saved!\n"); - + 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); if (!sd_save_to_file((u8 *)BOOTROM_BASE, BOOTROM_SIZE, path)) gfx_puts("\nbootrom_unpatched.bin saved!\n"); - + memcpy((void*)IPATCH_BASE, ipatch_backup, sizeof(ipatch_backup)); - + sd_unmount(); } diff --git a/bootloader/frontend/fe_tools.c b/bootloader/frontend/fe_tools.c index 75ae6e5..66904ce 100644 --- a/bootloader/frontend/fe_tools.c +++ b/bootloader/frontend/fe_tools.c @@ -133,13 +133,13 @@ void dump_packages12() if (kb <= KB_FIRMWARE_VERSION_620) { pkg1_unpack(warmboot, secmon, loader, pkg1_id, pkg1); - + // Display info. gfx_printf("%kNX Bootloader size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->ldr_size); - + gfx_printf("%kSecure monitor addr: %k0x%05X\n", 0xFFC7EA46, 0xFFCCCCCC, pkg1_id->secmon_base); gfx_printf("%kSecure monitor size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->sm_size); - + gfx_printf("%kWarmboot addr: %k0x%05X\n", 0xFFC7EA46, 0xFFCCCCCC, pkg1_id->warmboot_base); gfx_printf("%kWarmboot size: %k0x%05X\n\n", 0xFFC7EA46, 0xFFCCCCCC, hdr->wb_size); @@ -148,19 +148,19 @@ void dump_packages12() if (sd_save_to_file(pkg1, 0x40000, path)) goto out_free; gfx_puts("\npkg1 dumped to pkg1_decr.bin\n"); - + // Dump nxbootloader. emmcsn_path_impl(path, "/pkg1", "nxloader.bin", &storage); if (sd_save_to_file(loader, hdr->ldr_size, path)) goto out_free; gfx_puts("NX Bootloader dumped to nxloader.bin\n"); - + // Dump secmon. emmcsn_path_impl(path, "/pkg1", "secmon.bin", &storage); if (sd_save_to_file(secmon, hdr->sm_size, path)) goto out_free; gfx_puts("Secure Monitor dumped to secmon.bin\n"); - + // Dump warmboot. emmcsn_path_impl(path, "/pkg1", "warmboot.bin", &storage); if (sd_save_to_file(warmboot, hdr->wb_size, path)) @@ -187,7 +187,7 @@ void dump_packages12() // 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); // Decrypt package2 and parse KIP1 blobs in INI1 section. pkg2_hdr_t *pkg2_hdr = pkg2_decrypt(pkg2, kb); diff --git a/bootloader/gfx/di.c b/bootloader/gfx/di.c index 1dcef3f..5d84f60 100644 --- a/bootloader/gfx/di.c +++ b/bootloader/gfx/di.c @@ -254,6 +254,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); diff --git a/bootloader/gfx/di.h b/bootloader/gfx/di.h index 69d231a..2d5c54d 100644 --- a/bootloader/gfx/di.h +++ b/bootloader/gfx/di.h @@ -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, diff --git a/bootloader/gfx/di.inl b/bootloader/gfx/di.inl index 48cea7b..f8a32df 100644 --- a/bootloader/gfx/di.inl +++ b/bootloader/gfx/di.inl @@ -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}, diff --git a/bootloader/gfx/gfx.c b/bootloader/gfx/gfx.c index a5e9c4c..e2eabf1 100644 --- a/bootloader/gfx/gfx.c +++ b/bootloader/gfx/gfx.c @@ -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, @@ -185,7 +185,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++) @@ -254,7 +254,6 @@ void gfx_putc(char c) } break; } - } void gfx_puts(const char *s) diff --git a/bootloader/gfx/gfx.h b/bootloader/gfx/gfx.h index 94cb0ed..71e5fb0 100644 --- a/bootloader/gfx/gfx.h +++ b/bootloader/gfx/gfx.h @@ -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, diff --git a/bootloader/gfx/logos.h b/bootloader/gfx/logos.h index 5905665..24a8e93 100644 --- a/bootloader/gfx/logos.h +++ b/bootloader/gfx/logos.h @@ -1,5 +1,5 @@ /* - * 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, diff --git a/bootloader/gfx/tui.c b/bootloader/gfx/tui.c index 3ab56a2..cc2965c 100644 --- a/bootloader/gfx/tui.c +++ b/bootloader/gfx/tui.c @@ -83,7 +83,7 @@ void tui_pbar(int x, int y, u32 val, u32 fgcol, u32 bgcol) gfx_printf("%k[%3d%%]%k", fgcol, val, 0xFFCCCCCC); x += 7 * gfx_con.fntsz; - + for (int i = 0; i < (gfx_con.fntsz >> 3) * 6; i++) { gfx_line(x, y + i + 1, x + 3 * val, y + i + 1, fgcol); diff --git a/bootloader/gfx/tui.h b/bootloader/gfx/tui.h index 819a5db..abb8746 100644 --- a/bootloader/gfx/tui.h +++ b/bootloader/gfx/tui.h @@ -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, diff --git a/bootloader/hos/hos.c b/bootloader/hos/hos.c index ecc0b8c..5f86ea3 100644 --- a/bootloader/hos/hos.c +++ b/bootloader/hos/hos.c @@ -92,13 +92,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 }; static void _hos_crit_error(const char *text) @@ -255,7 +255,7 @@ int keygen(u8 *keyblob, u32 kb, tsec_ctxt_t *tsec_ctxt, launch_ctxt_t *hos_ctxt) se_aes_unwrap_key(13, 13, master_keyseed_620); se_aes_unwrap_key(12, 13, master_keyseed_retail); se_aes_unwrap_key(10, 13, master_keyseed_4xx_5xx_610); - + // Package2 key. se_aes_unwrap_key(8, 12, package2_keyseed); @@ -373,7 +373,7 @@ static u8 *_read_emmc_pkg2(launch_ctxt_t *ctxt) _hos_crit_error("Failed to init emuMMC"); return NULL; } - + emummc_storage_set_mmc_partition(&storage, 0); // Parse eMMC GPT. @@ -403,7 +403,7 @@ DPRINTF("pkg2 size on emmc is %08X\n", pkg2_size); DPRINTF("pkg2 size aligned is %08X\n", pkg2_size_aligned); ctxt->pkg2 = malloc(pkg2_size_aligned); ctxt->pkg2_size = pkg2_size; - nx_emmc_part_read(&storage, pkg2_part, BCT_SIZE / NX_EMMC_BLOCKSIZE, + nx_emmc_part_read(&storage, pkg2_part, BCT_SIZE / NX_EMMC_BLOCKSIZE, pkg2_size_aligned / NX_EMMC_BLOCKSIZE, ctxt->pkg2); out:; nx_emmc_gpt_free(&gpt); @@ -650,7 +650,7 @@ int hos_launch(ini_sec_t *cfg) // Finalize per firmware keys. int bootStateDramPkg2 = 0; int bootStatePkg2Continue = 0; - + switch (ctxt.pkg1_id->kb) { case KB_FIRMWARE_VERSION_100_200: diff --git a/bootloader/hos/hos_config.c b/bootloader/hos/hos_config.c index ff4e146..e05d918 100644 --- a/bootloader/hos/hos_config.c +++ b/bootloader/hos/hos_config.c @@ -36,7 +36,7 @@ static int _config_warmboot(launch_ctxt_t *ctxt, const char *value) ctxt->warmboot = sd_file_read(value, &ctxt->warmboot_size); if (!ctxt->warmboot) return 0; - + return 1; } diff --git a/bootloader/hos/pkg2.c b/bootloader/hos/pkg2.c index a7d5280..02350c8 100644 --- a/bootloader/hos/pkg2.c +++ b/bootloader/hos/pkg2.c @@ -534,7 +534,7 @@ static kip1_patchset_t _fs_patches_900[] = }; // SHA256 hashes. -static kip1_id_t _kip_ids[] = +static kip1_id_t _kip_ids[] = { { "FS", "\xde\x9f\xdd\xa4\x08\x5d\xd5\xfe", _fs_patches_100 }, // FS 1.0.0 { "FS", "\xfc\x3e\x80\x99\x1d\xca\x17\x96", _fs_patches_100 }, // FS 1.0.0 exfat @@ -636,7 +636,7 @@ static void parse_external_kip_patches() memcpy(patches[curr_patch_idx].srcData, pt->srcData, pt->length); memcpy(patches[curr_patch_idx].dstData, pt->dstData, pt->length); } - + curr_patch_idx++; } curr_patchset_idx++; @@ -754,19 +754,19 @@ int pkg2_decompress_kip(pkg2_kip1_info_t* ki, u32 sectsToDecomp) pkg2_kip1_t hdr; memcpy(&hdr, ki->kip1, sizeof(hdr)); - + unsigned int newKipSize = sizeof(hdr); for (u32 sectIdx = 0; sectIdx < KIP1_NUM_SECTIONS; sectIdx++) { u32 sectCompBit = 1u << sectIdx; // For compressed, cant get actual decompressed size without doing it, so use safe "output size". - if (sectIdx < 3 && (sectsToDecomp & sectCompBit) && (hdr.flags & sectCompBit)) + if (sectIdx < 3 && (sectsToDecomp & sectCompBit) && (hdr.flags & sectCompBit)) newKipSize += hdr.sections[sectIdx].size_decomp; else newKipSize += hdr.sections[sectIdx].size_comp; } - pkg2_kip1_t* newKip = malloc(newKipSize); + pkg2_kip1_t* newKip = malloc(newKipSize); unsigned char* dstDataPtr = newKip->data; const unsigned char* srcDataPtr = ki->kip1->data; for (u32 sectIdx = 0; sectIdx < KIP1_NUM_SECTIONS; sectIdx++) @@ -790,7 +790,7 @@ int pkg2_decompress_kip(pkg2_kip1_info_t* ki, u32 sectsToDecomp) gfx_printf("Decomping %s KIP1 sect %d of size %d...\n", (const char*)hdr.name, sectIdx, compSize); if (blz_uncompress_srcdest(srcDataPtr, compSize, dstDataPtr, outputSize) == 0) { - gfx_printf("%kERROR decomping sect %d of %s KIP!%k\n", 0xFFFF0000, sectIdx, (char*)hdr.name, 0xFFCCCCCC); + gfx_printf("%kERROR decomping sect %d of %s KIP!%k\n", 0xFFFF0000, sectIdx, (char*)hdr.name, 0xFFCCCCCC); free(newKip); return 1; @@ -972,7 +972,7 @@ const char* pkg2_patch_kips(link_t *info, char* patchNames) { if (!se_calc_sha256(shaBuf, ki->kip1, ki->size)) memset(shaBuf, 0, sizeof(shaBuf)); - } + } if (memcmp(shaBuf, _kip_ids[currKipIdx].hash, sizeof(_kip_ids[0].hash)) != 0) continue; @@ -995,7 +995,7 @@ const char* pkg2_patch_kips(link_t *info, char* patchNames) for (const kip1_patch_t* currPatch=currPatchset->patches; currPatch != NULL && (currPatch->length != 0); currPatch++) bitsAffected |= 1u << GET_KIP_PATCH_SECTION(currPatch->offset); } - } + } currPatchset++; } @@ -1060,7 +1060,7 @@ const char* pkg2_patch_kips(link_t *info, char* patchNames) } kipSectData += ki->kip1->sections[currSectIdx].size_comp; } - + patchesApplied |= appliedMask; break; } @@ -1101,7 +1101,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; diff --git a/bootloader/hos/pkg2.h b/bootloader/hos/pkg2.h index c637a76..febe2ac 100644 --- a/bootloader/hos/pkg2.h +++ b/bootloader/hos/pkg2.h @@ -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, diff --git a/bootloader/hos/pkg2_ini_kippatch.c b/bootloader/hos/pkg2_ini_kippatch.c index b71b06a..97d2751 100644 --- a/bootloader/hos/pkg2_ini_kippatch.c +++ b/bootloader/hos/pkg2_ini_kippatch.c @@ -28,7 +28,7 @@ static u8 *_htoa(u8 *result, const char *ptr, u8 byte_len) tmp = (ch - 'A' + 10); else if (ch >= 'a' && ch <= 'f') tmp = (ch - 'a' + 10); - + if (shift) *dst = (tmp << 4) & 0xF0; else diff --git a/bootloader/hos/secmon_exo.h b/bootloader/hos/secmon_exo.h index 7ab4c8b..2ff0ee3 100644 --- a/bootloader/hos/secmon_exo.h +++ b/bootloader/hos/secmon_exo.h @@ -1,5 +1,5 @@ /* - * 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, diff --git a/bootloader/hos/sept.c b/bootloader/hos/sept.c index dade7f5..614bf8c 100644 --- a/bootloader/hos/sept.c +++ b/bootloader/hos/sept.c @@ -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 @@ -83,7 +83,7 @@ void check_sept() f_unlink("sept/payload.bin"); f_rename("sept/payload.bak", "sept/payload.bin"); } - + return; } @@ -96,6 +96,7 @@ void check_sept() EPRINTF("Failed to init eMMC."); goto out_free; } + emummc_storage_set_mmc_partition(&storage, 1); // Read package1. @@ -130,7 +131,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; diff --git a/bootloader/libs/compr/blz.c b/bootloader/libs/compr/blz.c index a492b13..685ef4a 100644 --- a/bootloader/libs/compr/blz.c +++ b/bootloader/libs/compr/blz.c @@ -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; } } diff --git a/bootloader/libs/elfload/elfload.c b/bootloader/libs/elfload/elfload.c index 4155820..16f8200 100644 --- a/bootloader/libs/elfload/elfload.c +++ b/bootloader/libs/elfload/elfload.c @@ -14,7 +14,7 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ - + #include #include "elfload.h" diff --git a/bootloader/libs/elfload/elfload.h b/bootloader/libs/elfload/elfload.h index a261708..3a15dc2 100644 --- a/bootloader/libs/elfload/elfload.h +++ b/bootloader/libs/elfload/elfload.h @@ -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) */ diff --git a/bootloader/main.c b/bootloader/main.c index 65c13fe..bf64a86 100644 --- a/bootloader/main.c +++ b/bootloader/main.c @@ -252,14 +252,14 @@ void reloc_patcher(u32 payload_dst, u32 payload_src, u32 payload_size) bool is_ipl_updated(void *buf) { - ipl_ver_meta_t *update_ft = (ipl_ver_meta_t *)(buf + PATCHED_RELOC_SZ + sizeof(boot_cfg_t)); + ipl_ver_meta_t *update_ft = (ipl_ver_meta_t *)(buf + PATCHED_RELOC_SZ + sizeof(boot_cfg_t)); if (update_ft->magic == ipl_ver.magic) { if (byte_swap_32(update_ft->version) <= byte_swap_32(ipl_ver.version)) return true; return false; - + } else return true; @@ -398,7 +398,7 @@ void launch_tools() { memset(&ments[i + 2], 0, sizeof(ment_t)); menu_t menu = { ments, "Choose a file to launch", 0, 0 }; - + file_sec = (char *)tui_do_menu(&menu); if (!file_sec) @@ -421,7 +421,6 @@ void launch_tools() free(ments); goto out; } - if (file_sec) { @@ -915,7 +914,6 @@ void auto_launch_firmware() break; boot_entry_id++; } - } } @@ -1308,7 +1306,7 @@ void ipl_main() while (true) tui_do_menu(&menu_top); - + // Halt BPMP if we managed to get out of execution. while (true) bpmp_halt(); diff --git a/bootloader/mem/mtc_table.h b/bootloader/mem/mtc_table.h index 7f18232..38a3e2f 100644 --- a/bootloader/mem/mtc_table.h +++ b/bootloader/mem/mtc_table.h @@ -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; diff --git a/bootloader/mem/sdram_lp0_param_t210.h b/bootloader/mem/sdram_lp0_param_t210.h index 7f44f1d..9028990 100644 --- a/bootloader/mem/sdram_lp0_param_t210.h +++ b/bootloader/mem/sdram_lp0_param_t210.h @@ -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, diff --git a/bootloader/power/bq24193.c b/bootloader/power/bq24193.c index 20fec3a..6dd3cb1 100644 --- a/bootloader/power/bq24193.c +++ b/bootloader/power/bq24193.c @@ -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; diff --git a/bootloader/power/bq24193.h b/bootloader/power/bq24193.h index 9c7b74e..34e9fbf 100644 --- a/bootloader/power/bq24193.h +++ b/bootloader/power/bq24193.h @@ -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, diff --git a/bootloader/power/max17050.c b/bootloader/power/max17050.c index d34c340..635a437 100644 --- a/bootloader/power/max17050.c +++ b/bootloader/power/max17050.c @@ -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 - * 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; diff --git a/bootloader/power/max17050.h b/bootloader/power/max17050.h index 2196b80..e4c8acf 100644 --- a/bootloader/power/max17050.h +++ b/bootloader/power/max17050.h @@ -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 - * 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 diff --git a/bootloader/power/max77620.h b/bootloader/power/max77620.h index 479661d..435d55c 100644 --- a/bootloader/power/max77620.h +++ b/bootloader/power/max77620.h @@ -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 diff --git a/bootloader/rtc/max77620-rtc.c b/bootloader/rtc/max77620-rtc.c index 7e2d3af..e214363 100644 --- a/bootloader/rtc/max77620-rtc.c +++ b/bootloader/rtc/max77620-rtc.c @@ -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; diff --git a/bootloader/sec/se_t210.h b/bootloader/sec/se_t210.h index 760527d..72ceb24 100644 --- a/bootloader/sec/se_t210.h +++ b/bootloader/sec/se_t210.h @@ -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 diff --git a/bootloader/sec/tsec.c b/bootloader/sec/tsec.c index 06120e1..28ecafa 100644 --- a/bootloader/sec/tsec.c +++ b/bootloader/sec/tsec.c @@ -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++) diff --git a/bootloader/soc/fuse.c b/bootloader/soc/fuse.c index 54a93a0..04d3612 100644 --- a/bootloader/soc/fuse.c +++ b/bootloader/soc/fuse.c @@ -218,10 +218,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) { @@ -235,7 +235,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); } } @@ -248,7 +248,7 @@ int fuse_read_ipatch(void (*ipatch)(u32 offset, u32 value)) } word_count = word0 >> 25; } - + return 0; } @@ -275,10 +275,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) { @@ -314,7 +314,7 @@ int fuse_read_evp_thunk(u32 *iram_evp_thunks, u32 *iram_evp_thunks_len) } word_count = word0 >> 25; } - + return 0; } @@ -331,7 +331,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++) { diff --git a/bootloader/soc/hw_init.c b/bootloader/soc/hw_init.c index dc8f8f2..3694f52 100644 --- a/bootloader/soc/hw_init.c +++ b/bootloader/soc/hw_init.c @@ -55,9 +55,9 @@ void _config_oscillators() CLOCK(CLK_RST_CONTROLLER_SPARE_REG0) = (CLOCK(CLK_RST_CONTROLLER_SPARE_REG0) & 0xFFFFFFF3) | 4; // Set CLK_M_DIVISOR to 2. SYSCTR0(SYSCTR0_CNTFID0) = 19200000; // Set counter frequency. TMR(TIMERUS_USEC_CFG) = 0x45F; // For 19.2MHz clk_m. - CLOCK(CLK_RST_CONTROLLER_OSC_CTRL) = 0x50000071; // Set OSC to 38.4MHz and drive strength. + CLOCK(CLK_RST_CONTROLLER_OSC_CTRL) = 0x50000071; // Set OSC to 38.4MHz and drive strength. - PMC(APBDEV_PMC_OSC_EDPD_OVER) = (PMC(APBDEV_PMC_OSC_EDPD_OVER) & 0xFFFFFF81) | 0xE; // Set LP0 OSC drive strength. + PMC(APBDEV_PMC_OSC_EDPD_OVER) = (PMC(APBDEV_PMC_OSC_EDPD_OVER) & 0xFFFFFF81) | 0xE; // Set LP0 OSC drive strength. PMC(APBDEV_PMC_OSC_EDPD_OVER) = (PMC(APBDEV_PMC_OSC_EDPD_OVER) & 0xFFBFFFFF) | PMC_OSC_EDPD_OVER_OSC_CTRL_OVER; PMC(APBDEV_PMC_CNTRL2) = (PMC(APBDEV_PMC_CNTRL2) & 0xFFFFEFFF) | PMC_CNTRL2_HOLD_CKE_LOW_EN; PMC(APBDEV_PMC_SCRATCH188) = (PMC(APBDEV_PMC_SCRATCH188) & 0xFCFFFFFF) | (4 << 23); // LP0 EMC2TMC_CFG_XM2COMP_PU_VREF_SEL_RANGE. @@ -189,7 +189,7 @@ void _config_se_brom() if (!(b_cfg.boot_cfg & BOOT_CFG_SEPT_RUN)) { // Bootrom part we skipped. - u32 sbk[4] = { + u32 sbk[4] = { FUSE(FUSE_PRIVATE_KEY0), FUSE(FUSE_PRIVATE_KEY1), FUSE(FUSE_PRIVATE_KEY2), diff --git a/bootloader/soc/pinmux.h b/bootloader/soc/pinmux.h index 2db4a75..bb4ecb1 100644 --- a/bootloader/soc/pinmux.h +++ b/bootloader/soc/pinmux.h @@ -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) diff --git a/bootloader/soc/t210.h b/bootloader/soc/t210.h index 2f7fadd..ea83dbc 100644 --- a/bootloader/soc/t210.h +++ b/bootloader/soc/t210.h @@ -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. */ diff --git a/bootloader/soc/uart.c b/bootloader/soc/uart.c index 056f864..63a6bcd 100644 --- a/bootloader/soc/uart.c +++ b/bootloader/soc/uart.c @@ -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; diff --git a/bootloader/storage/emummc.c b/bootloader/storage/emummc.c index 5be1b4c..2945b30 100644 --- a/bootloader/storage/emummc.c +++ b/bootloader/storage/emummc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CTCaer + * Copyright (c) 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, @@ -180,7 +180,7 @@ int emummc_storage_read(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, v f_close(&fp); return 0; } - + f_close(&fp); return 1; } @@ -225,7 +225,7 @@ int emummc_storage_write(sdmmc_storage_t *storage, u32 sector, u32 num_sectors, f_close(&fp); return 0; } - + f_close(&fp); return 1; } diff --git a/bootloader/storage/emummc.h b/bootloader/storage/emummc.h index 0804ea6..5ef8cfd 100644 --- a/bootloader/storage/emummc.h +++ b/bootloader/storage/emummc.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 CTCaer + * Copyright (c) 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, diff --git a/bootloader/storage/sd.h b/bootloader/storage/sd.h index c3bf82b..0c680c4 100644 --- a/bootloader/storage/sd.h +++ b/bootloader/storage/sd.h @@ -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 diff --git a/bootloader/storage/sdmmc.c b/bootloader/storage/sdmmc.c index 8ec807c..aeaa45e 100644 --- a/bootloader/storage/sdmmc.c +++ b/bootloader/storage/sdmmc.c @@ -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, @@ -1064,7 +1064,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(); diff --git a/bootloader/storage/sdmmc.h b/bootloader/storage/sdmmc.h index fdc2bbb..c8b8f96 100644 --- a/bootloader/storage/sdmmc.h +++ b/bootloader/storage/sdmmc.h @@ -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, diff --git a/bootloader/storage/sdmmc_driver.c b/bootloader/storage/sdmmc_driver.c index 0c0c2ff..4709541 100644 --- a/bootloader/storage/sdmmc_driver.c +++ b/bootloader/storage/sdmmc_driver.c @@ -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; diff --git a/bootloader/utils/btn.c b/bootloader/utils/btn.c index f0a8ffc..63a983a 100644 --- a/bootloader/utils/btn.c +++ b/bootloader/utils/btn.c @@ -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, diff --git a/bootloader/utils/btn.h b/bootloader/utils/btn.h index ede13ac..8394a52 100644 --- a/bootloader/utils/btn.h +++ b/bootloader/utils/btn.h @@ -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, diff --git a/bootloader/utils/dirlist.c b/bootloader/utils/dirlist.c index 8e6f3cc..b4d0169 100644 --- a/bootloader/utils/dirlist.c +++ b/bootloader/utils/dirlist.c @@ -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); @@ -79,7 +79,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); diff --git a/bootloader/utils/util.c b/bootloader/utils/util.c index a1dd7cc..2365df5 100644 --- a/bootloader/utils/util.c +++ b/bootloader/utils/util.c @@ -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, @@ -88,7 +88,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); } diff --git a/bootloader/utils/util.h b/bootloader/utils/util.h index 3a81e55..f257b7c 100644 --- a/bootloader/utils/util.h +++ b/bootloader/utils/util.h @@ -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, diff --git a/common/common_gfx.h b/common/common_gfx.h index f0b978d..b6dbdab 100644 --- a/common/common_gfx.h +++ b/common/common_gfx.h @@ -1,9 +1,9 @@ /* * Common Gfx Header * Copyright (c) 2018 naehrwert - * Copyright (C) 2018 CTCaer - * Copyright (C) 2018 M4xw - * + * Copyright (c) 2018 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, * version 2, as published by the Free Software Foundation. diff --git a/common/common_module.h b/common/common_module.h index 2dab75e..93a1541 100644 --- a/common/common_module.h +++ b/common/common_module.h @@ -1,7 +1,7 @@ /* * Common Module Header - * Copyright (C) 2018 M4xw - * + * 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, * version 2, as published by the Free Software Foundation. diff --git a/modules/hekate_libsys_lp0/Makefile b/modules/hekate_libsys_lp0/Makefile index b789d38..c0751f5 100644 --- a/modules/hekate_libsys_lp0/Makefile +++ b/modules/hekate_libsys_lp0/Makefile @@ -23,7 +23,7 @@ all: $(TARGET).bso $(BUILD)/%.o: ./%.c @mkdir -p "$(BUILD)" $(CC) $(CFLAGS) -c $< -o $@ - + $(TARGET).bso: $(OBJS) $(CC) $(LDFLAGS) -e _modInit $^ -o $(OUTPUT)/$(TARGET).bso $(STRIP) -g $(OUTPUT)/$(TARGET).bso diff --git a/modules/hekate_libsys_lp0/sdram_lp0_param_t210.h b/modules/hekate_libsys_lp0/sdram_lp0_param_t210.h index 523a50f..c9237f2 100644 --- a/modules/hekate_libsys_lp0/sdram_lp0_param_t210.h +++ b/modules/hekate_libsys_lp0/sdram_lp0_param_t210.h @@ -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, diff --git a/modules/hekate_libsys_lp0/sys_sdramlp0.c b/modules/hekate_libsys_lp0/sys_sdramlp0.c index 52e85a7..44dffd4 100644 --- a/modules/hekate_libsys_lp0/sys_sdramlp0.c +++ b/modules/hekate_libsys_lp0/sys_sdramlp0.c @@ -1,8 +1,8 @@ /* * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved. * Copyright 2014 Google Inc. - * Copyright (C) 2018 naehrwert - * Copyright (C) 2018 CTCaer + * Copyright (c) 2018 naehrwert + * 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, diff --git a/modules/hekate_libsys_minerva/Makefile b/modules/hekate_libsys_minerva/Makefile index a054881..90a2ab0 100644 --- a/modules/hekate_libsys_minerva/Makefile +++ b/modules/hekate_libsys_minerva/Makefile @@ -23,7 +23,7 @@ all: $(TARGET).bso $(BUILD)/%.o: ./%.c @mkdir -p "$(BUILD)" $(CC) $(CFLAGS) -c $< -o $@ - + $(TARGET).bso: $(OBJS) $(CC) $(LDFLAGS) -e _minerva_init $^ -o $(OUTPUT)/$(TARGET).bso $(STRIP) -g $(OUTPUT)/$(TARGET).bso diff --git a/modules/hekate_libsys_minerva/README.md b/modules/hekate_libsys_minerva/README.md index 618b9f2..9f6e2ed 100644 --- a/modules/hekate_libsys_minerva/README.md +++ b/modules/hekate_libsys_minerva/README.md @@ -7,7 +7,7 @@ For more, check [Here](https://github.com/CTCaer/minerva_tc). ``` -Minerva Training Cell (C) 2018 CTCaer. +Minerva Training Cell (c) 2018 CTCaer. /* Pain... And suffering. */ ``` diff --git a/modules/hekate_libsys_minerva/mtc_table.h b/modules/hekate_libsys_minerva/mtc_table.h index 6301ff8..d66d0dd 100644 --- a/modules/hekate_libsys_minerva/mtc_table.h +++ b/modules/hekate_libsys_minerva/mtc_table.h @@ -22,7 +22,7 @@ #include "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; diff --git a/modules/hekate_libsys_minerva/sys_sdrammtc.c b/modules/hekate_libsys_minerva/sys_sdrammtc.c index 5031a05..0310d65 100644 --- a/modules/hekate_libsys_minerva/sys_sdrammtc.c +++ b/modules/hekate_libsys_minerva/sys_sdrammtc.c @@ -1257,7 +1257,7 @@ static u32 _digital_dll_prelock(emc_table_t *mtc_table_entry, u32 needs_tristate _change_dll_src(mtc_table_entry, selected_clk_src_emc); EMC(EMC_CFG_DIG_DLL) |= 1; - + _timing_update(dual_channel); while (!(EMC(EMC_CFG_DIG_DLL) & 1)) @@ -1274,6 +1274,7 @@ static u32 _digital_dll_prelock(emc_table_t *mtc_table_entry, u32 needs_tristate EMC(EMC_DBG) |= 2u; EMC(EMC_CFG_DIG_DLL) &= 0xFFFFFFFE; //Disable CFG_DLL_EN: [PMC] Enable digital DLL. EMC(EMC_DBG) &= 0xFFFFFFFD; + while (EMC(EMC_CFG_DIG_DLL) & 1) ; if (dual_channel) @@ -2043,7 +2044,7 @@ static u32 _minerva_apply_periodic_compensation_trimmer(emc_table_t *mtc_table_e u32 dst_rate_mhz = mtc_table_entry->rate_khz / 1000; - switch (trim_emc_reg_addr) + switch (trim_emc_reg_addr) { case EMC_PMACRO_OB_DDLL_LONG_DQ_RANK0_0: case EMC_PMACRO_OB_DDLL_LONG_DQ_RANK0_1: @@ -2420,12 +2421,12 @@ static void _save_train_results(emc_table_t *mtc_table_entry, u32 needs_training if (mtc_table_entry->save_restore_mod_regs[3] & 0x80000000) ib_vref_dq_byte3_icr = ((EMC(EMC_PMACRO_IB_VREF_DQ_0) >> 24) & 0x7F) - (mtc_table_entry->save_restore_mod_regs[3] & 0x7F); - mtc_table_entry->trim_regs.emc_pmacro_ib_vref_dq_0_idx = + mtc_table_entry->trim_regs.emc_pmacro_ib_vref_dq_0_idx = ((ib_vref_dq_byte0_icr & 0x7F) | (ib_vref_dq_byte1_icr & 0x7F) << 8) | ((ib_vref_dq_byte2_icr & 0x7F) << 16) | ((ib_vref_dq_byte3_icr & 0x7F) << 24); - + char ib_vref_dq_byte4_icr = (EMC(EMC_PMACRO_IB_VREF_DQ_1) & 0x7F) + (mtc_table_entry->save_restore_mod_regs[4] & 0x7F); if (mtc_table_entry->save_restore_mod_regs[4] & 0x80000000) ib_vref_dq_byte4_icr = (EMC(EMC_PMACRO_IB_VREF_DQ_1) & 0x7F) - (mtc_table_entry->save_restore_mod_regs[4] & 0x7F); @@ -2575,7 +2576,6 @@ static void _save_train_results(emc_table_t *mtc_table_entry, u32 needs_training mtc_table_entry->burst_reg_per_ch.emc0_mrw12_idx = emc0_ib_vref_dq_byte8_modded_plus | 0x880E0000 | (emc0_mrw12_op_sp1 << 8); mtc_table_entry->burst_reg_per_ch.emc0_mrw13_idx = emc0_ib_vref_dq_byte9_modded_a_plus << 8 | emc0_mrw13_op_sp0 | mr13_dev_ext_cnt_sp_addr; mtc_table_entry->burst_reg_per_ch.emc1_mrw13_idx = (emc1_mrw13_op_sp1 << 8) | emc1_mrw13_op_sp0 | mr13_dev_ext_cnt_sp_addr; - } } } @@ -2740,7 +2740,7 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u // Check if we need to turn on VREF generator. if ((!(src_emc_entry->burst_regs.emc_pmacro_data_pad_tx_ctrl_idx & 0x100) && (dst_emc_entry->burst_regs.emc_pmacro_data_pad_tx_ctrl_idx & 0x100)) - || (!(src_emc_entry->burst_regs.emc_pmacro_data_pad_tx_ctrl_idx & 1) + || (!(src_emc_entry->burst_regs.emc_pmacro_data_pad_tx_ctrl_idx & 1) && (dst_emc_entry->burst_regs.emc_pmacro_data_pad_tx_ctrl_idx & 1))) { EMC(EMC_PMACRO_DATA_PAD_TX_CTRL) = @@ -2756,7 +2756,7 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u // Step 2 - Prelock the DLL. EPRINTF("Step 2"); if (dst_emc_entry->burst_regs.emc_cfg_dig_dll_idx & 1) - _digital_dll_prelock(dst_emc_entry, needs_tristate_training, selected_clk_src_emc); //Prelock enabled for target frequency. + _digital_dll_prelock(dst_emc_entry, needs_tristate_training, selected_clk_src_emc); // Prelock enabled for target frequency. else { _change_dll_src(dst_emc_entry, selected_clk_src_emc); @@ -3235,6 +3235,7 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u ref_delay = (u32)(float)(tRP_src_timing + tRFC_src_timing + 20.0f); _ccfifo_write(EMC_CFG_SYNC, 0, ref_delay); _ccfifo_write(EMC_DBG, emc_dbg_val | 0x40000002, 0); // WRITE_MUX_ACTIVE | WRITE_ACTIVE_ONLY + ramp_down_wait = _dvfs_power_ramp_down(false, src_emc_entry, dst_emc_entry, src_clock_period); // Step 12 - Trigger clock change. @@ -3246,6 +3247,7 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u // Step 13 - Ramp up. EPRINTF("Step 13"); ramp_up_wait = _dvfs_power_ramp_up(false, src_emc_entry, dst_emc_entry, needs_training & 0xFF, dst_clock_period); + _ccfifo_write(EMC_DBG, emc_dbg_val, 0); // Step 14 - Bringup CKE pins. @@ -3313,17 +3315,22 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u T_PDEX_timing_final = 0; _ccfifo_write(EMC_ZQ_CAL, 0x80000001, T_PDEX_timing_final); } + T_PDEX_timing_final = zq_latch_dvfs_wait_time + T_PDEX_timing; + if ((zq_latch_dvfs_wait_time + T_PDEX_timing) < 0) T_PDEX_timing_final = 0; + _ccfifo_write(EMC_ZQ_CAL, 0x80000002, T_PDEX_timing_final); _ccfifo_write(EMC_ZQ_CAL, 0x40000001, 0); + if (!needs_tristate_training) { _ccfifo_write(EMC_MRW3, (mr13_flip_fspop & 0xF3FFFFF7) | 0xC000000, 0); _ccfifo_write(EMC_SELF_REF, 0x100, 0); _ccfifo_write(EMC_REF, 0, 0); } + emc_zq_cal = 0x40000002; zq_latch_dvfs_wait_time = (s32)(float)(1000.0f / dst_clock_period); } @@ -3334,20 +3341,23 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u if (src_clock_period > 2.0) _ccfifo_write(EMC_ZQ_CAL, 1, T_PDEX_timing); + if (!needs_tristate_training) { _ccfifo_write(EMC_MRW3, (mr13_flip_fspop & 0xF3FFFFF7) | 0xC000000, T_PDEX_timing); _ccfifo_write(EMC_SELF_REF, 0x100, 0); _ccfifo_write(EMC_REF, 0, 0); } + emc_zq_cal = 2; if (zq_latch_dvfs_wait_time < 0) zq_latch_dvfs_wait_time = 0; } + _ccfifo_write(EMC_ZQ_CAL, emc_zq_cal, (u32)zq_latch_dvfs_wait_time); } - + _ccfifo_write(EMC_INTSTATUS, 0, 10); // WAR: delay for zqlatch. // Step 16 - LPDDR4 Conditional training kickoff. @@ -3422,6 +3432,7 @@ s32 _minerva_set_clock(emc_table_t *src_emc_entry, emc_table_t *dst_emc_entry, u _ccfifo_write(EMC_INTSTATUS, 0, (u32)(float)(1000.0f / src_clock_period)); _ccfifo_write(EMC_PMACRO_DATA_RX_TERM_MODE, src_emc_entry->burst_regs.emc_pmacro_data_rx_term_mode_idx, 0); } + _ccfifo_write(EMC_DBG, emc_dbg_o, 0); if (opt_zcal_en_cc) @@ -3566,6 +3577,7 @@ step_19_2: _ccfifo_write(EMC_SEL_DPD_CTRL, src_emc_entry->emc_sel_dpd_ctrl, 0); _ccfifo_write(EMC_DBG, emc_dbg_o, 0); _ccfifo_write(EMC_CFG_PIPE_CLK, emc_cfg_pipe_clk_o, 0); + if (bg_regulator_mode_change) { if (enable_bg_regulator) @@ -3582,8 +3594,9 @@ step_19_2: _change_dll_src(src_emc_entry, (u32)CLOCK(CLK_RST_CONTROLLER_CLK_SOURCE_EMC)); } EMC(EMC_CFG_DIG_DLL) = (EMC(EMC_CFG_DIG_DLL) & 0xFFFFFF24) | 0x88; - + CLOCK(CLK_RST_CONTROLLER_CLK_SOURCE_EMC) = selected_clk_src_emc; + if (_wait_emc_status(EMC_INTSTATUS, CLKCHANGE_COMPLETE_INT, true, 0)) return 4; // Clkchange handshake timeout error. @@ -3916,12 +3929,15 @@ s32 _minerva_set_rate(mtc_config_t *mtc_cfg) if (mtc_cfg->rate_to == table_entry_rate) dst_emc_entry_idx = i; } + src_emc_entry = (emc_table_t *)&mtc_cfg->mtc_table[src_emc_entry_idx]; dst_emc_entry = (emc_table_t *)&mtc_cfg->mtc_table[dst_emc_entry_idx]; + s32 src_rate_khz = src_emc_entry->rate_khz; s32 dst_rate_khz = dst_emc_entry->rate_khz; u32 src_clk_src_emc = src_emc_entry->clk_src_emc; u32 dst_clk_src_emc = dst_emc_entry->clk_src_emc; + if (mtc_cfg->table_entries > 900) return 4; @@ -4027,11 +4043,11 @@ void _minerva_init(mtc_config_t *mtc_cfg, void* bp) _minerva_get_table(mtc_cfg); return; } - - // If this is set, it need to be managed. Changing freq from OC to a lower + + // If this is set, it needs to be managed. Changing freq from OC to a lower // must have the rate_from set to 2131200 and not 1600000 // bool overclock = true; - + // if (overclock && mtc_cfg->rate_to == 1600000) // { // mtc_cfg->rate_to = 2131200; diff --git a/modules/simple_sample/Makefile b/modules/simple_sample/Makefile index a12130e..d1aa6c9 100644 --- a/modules/simple_sample/Makefile +++ b/modules/simple_sample/Makefile @@ -24,7 +24,7 @@ all: $(TARGET).bso $(BUILD)/%.o: ./%.c @mkdir -p "$(BUILD)" $(CC) $(CFLAGS) -c $< -o $@ - + $(TARGET).bso: $(OBJS) $(CC) $(LDFLAGS) -e _modInit $^ -o $(OUTPUT)/$(TARGET).bso $(STRIP) -g $(OUTPUT)/$(TARGET).bso diff --git a/modules/simple_sample/gfx/gfx.c b/modules/simple_sample/gfx/gfx.c index 8a0b810..9a154bc 100644 --- a/modules/simple_sample/gfx/gfx.c +++ b/modules/simple_sample/gfx/gfx.c @@ -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, @@ -254,7 +254,6 @@ void gfx_putc(gfx_con_t *con, char c) } break; } - } void gfx_puts(gfx_con_t *con, const char *s) diff --git a/modules/simple_sample/gfx/gfx.h b/modules/simple_sample/gfx/gfx.h index 3bea883..ecf42c9 100644 --- a/modules/simple_sample/gfx/gfx.h +++ b/modules/simple_sample/gfx/gfx.h @@ -1,7 +1,7 @@ /* * Copyright (c) 2018 naehrwert - * Copyright (C) 2018 CTCaer - * Copyright (C) 2018 M4xw + * Copyright (c) 2018 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, diff --git a/nyx/nyx_gui/config/ini.c b/nyx/nyx_gui/config/ini.c index 8485c20..5d18f94 100644 --- a/nyx/nyx_gui/config/ini.c +++ b/nyx/nyx_gui/config/ini.c @@ -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, diff --git a/nyx/nyx_gui/config/ini.h b/nyx/nyx_gui/config/ini.h index 318adf0..dffbe86 100644 --- a/nyx/nyx_gui/config/ini.h +++ b/nyx/nyx_gui/config/ini.h @@ -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, diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index d9bcd6b..9e4a54e 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -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: diff --git a/nyx/nyx_gui/frontend/fe_emummc_tools.c b/nyx/nyx_gui/frontend/fe_emummc_tools.c index 42e5a65..df85789 100644 --- a/nyx/nyx_gui/frontend/fe_emummc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emummc_tools.c @@ -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: diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index effb989..1cbdd7a 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -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. diff --git a/nyx/nyx_gui/frontend/gui_emmc_tools.c b/nyx/nyx_gui/frontend/gui_emmc_tools.c index f2f231a..09e0a3b 100644 --- a/nyx/nyx_gui/frontend/gui_emmc_tools.c +++ b/nyx/nyx_gui/frontend/gui_emmc_tools.c @@ -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); diff --git a/nyx/nyx_gui/frontend/gui_emummc_tools.c b/nyx/nyx_gui/frontend/gui_emummc_tools.c index 766c6a2..b0ab039 100644 --- a/nyx/nyx_gui/frontend/gui_emummc_tools.c +++ b/nyx/nyx_gui/frontend/gui_emummc_tools.c @@ -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); diff --git a/nyx/nyx_gui/frontend/gui_info.c b/nyx/nyx_gui/frontend/gui_info.c index 5047eca..739aebd 100644 --- a/nyx/nyx_gui/frontend/gui_info.c +++ b/nyx/nyx_gui/frontend/gui_info.c @@ -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); diff --git a/nyx/nyx_gui/frontend/gui_options.c b/nyx/nyx_gui/frontend/gui_options.c index debea47..2cfca4c 100644 --- a/nyx/nyx_gui/frontend/gui_options.c +++ b/nyx/nyx_gui/frontend/gui_options.c @@ -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); diff --git a/nyx/nyx_gui/frontend/gui_tools.c b/nyx/nyx_gui/frontend/gui_tools.c index 4ec2f8f..aade735 100644 --- a/nyx/nyx_gui/frontend/gui_tools.c +++ b/nyx/nyx_gui/frontend/gui_tools.c @@ -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"); diff --git a/nyx/nyx_gui/gfx/di.c b/nyx/nyx_gui/gfx/di.c index 75d24ae..74bca70 100644 --- a/nyx/nyx_gui/gfx/di.c +++ b/nyx/nyx_gui/gfx/di.c @@ -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); diff --git a/nyx/nyx_gui/gfx/di.h b/nyx/nyx_gui/gfx/di.h index 9be7954..fe5fe04 100644 --- a/nyx/nyx_gui/gfx/di.h +++ b/nyx/nyx_gui/gfx/di.h @@ -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, diff --git a/nyx/nyx_gui/gfx/di.inl b/nyx/nyx_gui/gfx/di.inl index 2f53c11..d6ad3bf 100644 --- a/nyx/nyx_gui/gfx/di.inl +++ b/nyx/nyx_gui/gfx/di.inl @@ -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. diff --git a/nyx/nyx_gui/gfx/gfx.c b/nyx/nyx_gui/gfx/gfx.c index 4eabaa0..578c8f7 100644 --- a/nyx/nyx_gui/gfx/gfx.c +++ b/nyx/nyx_gui/gfx/gfx.c @@ -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) diff --git a/nyx/nyx_gui/gfx/gfx.h b/nyx/nyx_gui/gfx/gfx.h index b3d0aca..0d09576 100644 --- a/nyx/nyx_gui/gfx/gfx.h +++ b/nyx/nyx_gui/gfx/gfx.h @@ -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, diff --git a/nyx/nyx_gui/hos/hos.c b/nyx/nyx_gui/hos/hos.c index 43d7725..2526e6c 100644 --- a/nyx/nyx_gui/hos/hos.c +++ b/nyx/nyx_gui/hos/hos.c @@ -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) diff --git a/nyx/nyx_gui/hos/pkg2.c b/nyx/nyx_gui/hos/pkg2.c index f9c15f2..b8ba50e 100644 --- a/nyx/nyx_gui/hos/pkg2.c +++ b/nyx/nyx_gui/hos/pkg2.c @@ -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; diff --git a/nyx/nyx_gui/hos/pkg2.h b/nyx/nyx_gui/hos/pkg2.h index 60e6f87..db6c03c 100644 --- a/nyx/nyx_gui/hos/pkg2.h +++ b/nyx/nyx_gui/hos/pkg2.h @@ -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, diff --git a/nyx/nyx_gui/hos/sept.c b/nyx/nyx_gui/hos/sept.c index e2a7c20..907ea8f 100644 --- a/nyx/nyx_gui/hos/sept.c +++ b/nyx/nyx_gui/hos/sept.c @@ -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; diff --git a/nyx/nyx_gui/input/als.c b/nyx/nyx_gui/input/als.c index 47aad77..ef9a4c8 100644 --- a/nyx/nyx_gui/input/als.c +++ b/nyx/nyx_gui/input/als.c @@ -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]; diff --git a/nyx/nyx_gui/input/touch.c b/nyx/nyx_gui/input/touch.c index 2e0f608..ba2c26a 100644 --- a/nyx/nyx_gui/input/touch.c +++ b/nyx/nyx_gui/input/touch.c @@ -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); diff --git a/nyx/nyx_gui/libs/compr/blz.c b/nyx/nyx_gui/libs/compr/blz.c index 487fa26..e0a0e7b 100644 --- a/nyx/nyx_gui/libs/compr/blz.c +++ b/nyx/nyx_gui/libs/compr/blz.c @@ -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; } } diff --git a/nyx/nyx_gui/libs/elfload/elfload.c b/nyx/nyx_gui/libs/elfload/elfload.c index 84201ec..1c3e464 100644 --- a/nyx/nyx_gui/libs/elfload/elfload.c +++ b/nyx/nyx_gui/libs/elfload/elfload.c @@ -14,7 +14,7 @@ * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR * PERFORMANCE OF THIS SOFTWARE. */ - + #include #include "elfload.h" diff --git a/nyx/nyx_gui/libs/elfload/elfload.h b/nyx/nyx_gui/libs/elfload/elfload.h index a261708..3a15dc2 100644 --- a/nyx/nyx_gui/libs/elfload/elfload.h +++ b/nyx/nyx_gui/libs/elfload/elfload.h @@ -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) */ diff --git a/nyx/nyx_gui/libs/fatfs/ff.c b/nyx/nyx_gui/libs/fatfs/ff.c index 0ad9d3d..6d7be7c 100644 --- a/nyx/nyx_gui/libs/fatfs/ff.c +++ b/nyx/nyx_gui/libs/fatfs/ff.c @@ -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; diff --git a/nyx/nyx_gui/libs/lvgl/lv_core/lv_obj.c b/nyx/nyx_gui/libs/lvgl/lv_core/lv_obj.c index 07407ae..95c41a8 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_core/lv_obj.c +++ b/nyx/nyx_gui/libs/lvgl/lv_core/lv_obj.c @@ -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); diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_120.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_120.c index f9d2d9f..f99c06e 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_120.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_120.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_20.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_20.c index e6b622d..23ade6f 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_20.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_20.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_30.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_30.c index f8df9b0..91b4378 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_30.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/hekate_symbol_30.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_20.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_20.c index 1789ae5..f5b6880 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_20.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_20.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_30.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_30.c index 111e078..61b5530 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_30.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/interui_30.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_fonts/ubuntu_mono.c b/nyx/nyx_gui/libs/lvgl/lv_fonts/ubuntu_mono.c index 2b1c96c..23baa97 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_fonts/ubuntu_mono.c +++ b/nyx/nyx_gui/libs/lvgl/lv_fonts/ubuntu_mono.c @@ -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*/ diff --git a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.c b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.c index 71effb6..5ec5832 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.c +++ b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.c @@ -25,7 +25,7 @@ * STATIC VARIABLES **********************/ #if (!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 -LV_ROOTS +LV_ROOTS #endif /* LV_ENABLE_GC */ /********************** * MACROS diff --git a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.h b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.h index 78e4ef5..660d7f0 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.h +++ b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_gc.h @@ -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) diff --git a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_txt.c b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_txt.c index 09c3186..d80c3b4 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_misc/lv_txt.c +++ b/nyx/nyx_gui/libs/lvgl/lv_misc/lv_txt.c @@ -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; diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_calendar.c b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_calendar.c index 543c8d3..50304c3 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_calendar.c +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_calendar.c @@ -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); diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.c b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.c index b28f238..0c6d9dd 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.c +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.c @@ -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 = x0dy ? 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) { diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.h b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.h index 74e1134..cd5827f 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.h +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_canvas.h @@ -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); diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.c b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.c index c3a0de9..c3776e8 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.c +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.c @@ -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) { diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.h b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.h index 758e72e..db00080 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.h +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_ddlist.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + /** * @file lv_ddlist.h * diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.c b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.c index 1f19215..b01172f 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.c +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.c @@ -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; diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.h b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.h index a318770..01ebb19 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.h +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_list.h @@ -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 diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_page.h b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_page.h index d95f169..caed34e 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_page.h +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_page.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + /** * @file lv_page.h * diff --git a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_win.c b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_win.c index 318da42..c21c08d 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_objx/lv_win.c +++ b/nyx/nyx_gui/libs/lvgl/lv_objx/lv_win.c @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + /** * @file lv_win.c * diff --git a/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme.h b/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme.h index d609051..f66f9c8 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme.h +++ b/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme.h @@ -13,7 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - + /** *@file lv_themes.h * diff --git a/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme_hekate.c b/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme_hekate.c index 2bdd095..423fcaf 100644 --- a/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme_hekate.c +++ b/nyx/nyx_gui/libs/lvgl/lv_themes/lv_theme_hekate.c @@ -66,46 +66,45 @@ static lv_font_t * _font; static void basic_init(void) { - static lv_style_t bg, panel; + static lv_style_t bg, panel; - lv_style_copy(&def, &lv_style_plain); /*Initialize the default style*/ - def.text.font = _font; - def.body.radius = DEF_RADIUS; + lv_style_copy(&def, &lv_style_plain); // Initialize the default style. + def.text.font = _font; + def.body.radius = DEF_RADIUS; def.text.color = COLOR_HOS_TXT_WHITE; - //def.image.color = COLOR_HOS_TXT_WHITE; //Needed if symbol image + //def.image.color = COLOR_HOS_TXT_WHITE; //Needed if symbol image. //def.image.opa = LV_OPA_COVER; - lv_style_copy(&bg, &def); - bg.body.main_color = COLOR_HOS_BG; + lv_style_copy(&bg, &def); + bg.body.main_color = COLOR_HOS_BG; //bg.body.main_color = LV_COLOR_BLACK; - bg.body.grad_color = bg.body.main_color; - bg.body.radius = 0; - bg.body.empty = 1; + bg.body.grad_color = bg.body.main_color; + bg.body.radius = 0; + bg.body.empty = 1; - lv_style_copy(&panel, &def); - panel.body.radius = DEF_RADIUS; - panel.body.main_color = COLOR_HOS_BG; - panel.body.grad_color = COLOR_HOS_BG; - panel.body.border.width = 1; + lv_style_copy(&panel, &def); + panel.body.radius = DEF_RADIUS; + panel.body.main_color = COLOR_HOS_BG; + panel.body.grad_color = COLOR_HOS_BG; + panel.body.border.width = 1; panel.body.border.color = LV_COLOR_HEX(0x4D4D4D); - panel.body.border.opa = LV_OPA_COVER; - panel.body.shadow.color = COLOR_SHADOW_LIGHT; - panel.body.shadow.type = LV_SHADOW_BOTTOM; - panel.body.shadow.width = 4; - panel.body.padding.hor = LV_DPI / 8; - panel.body.padding.ver = LV_DPI / 8; - panel.body.padding.inner = LV_DPI / 12; + panel.body.border.opa = LV_OPA_COVER; + panel.body.shadow.color = COLOR_SHADOW_LIGHT; + panel.body.shadow.type = LV_SHADOW_BOTTOM; + panel.body.shadow.width = 4; + panel.body.padding.hor = LV_DPI / 8; + panel.body.padding.ver = LV_DPI / 8; + panel.body.padding.inner = LV_DPI / 12; //panel.text.color = COLOR_HOS_TXT_WHITE; - lv_style_copy(&sb, &def); - sb.body.main_color = LV_COLOR_BLACK; - sb.body.grad_color = LV_COLOR_BLACK; - sb.body.opa = LV_OPA_40; - sb.body.padding.hor = LV_DPI / 25; - - theme.bg = &bg; - theme.panel = &panel; + lv_style_copy(&sb, &def); + sb.body.main_color = LV_COLOR_BLACK; + sb.body.grad_color = LV_COLOR_BLACK; + sb.body.opa = LV_OPA_40; + sb.body.padding.hor = LV_DPI / 25; + theme.bg = &bg; + theme.panel = &panel; } static void cont_init(void) @@ -116,60 +115,60 @@ static void cont_init(void) cont.body.shadow.width = 0; cont.body.border.width = 0; - theme.cont = &cont; + theme.cont = &cont; #endif } static void btn_init(void) { #if USE_LV_BTN != 0 - static lv_style_t rel, pr, tgl_rel, tgl_pr, ina; + static lv_style_t rel, pr, tgl_rel, tgl_pr, ina; - lv_style_copy(&rel, &def); - rel.body.main_color = COLOR_HOS_BG_LIGHT; - rel.body.grad_color = rel.body.main_color; - rel.body.radius = 6; - rel.body.padding.hor = LV_DPI / 3; - rel.body.padding.ver = LV_DPI / 6; - rel.body.padding.inner = LV_DPI / 10; - rel.body.shadow.color = COLOR_SHADOW_DARK; - rel.body.shadow.type = LV_SHADOW_BOTTOM; - rel.body.shadow.width = 6; + lv_style_copy(&rel, &def); + rel.body.main_color = COLOR_HOS_BG_LIGHT; + rel.body.grad_color = rel.body.main_color; + rel.body.radius = 6; + rel.body.padding.hor = LV_DPI / 3; + rel.body.padding.ver = LV_DPI / 6; + rel.body.padding.inner = LV_DPI / 10; + rel.body.shadow.color = COLOR_SHADOW_DARK; + rel.body.shadow.type = LV_SHADOW_BOTTOM; + rel.body.shadow.width = 6; rel.body.border.width = 0; - rel.body.border.color = COLOR_HOS_BG_LIGHT; - rel.body.border.part = LV_BORDER_FULL; + rel.body.border.color = COLOR_HOS_BG_LIGHT; + rel.body.border.part = LV_BORDER_FULL; //rel.text.color = COLOR_HOS_TXT_WHITE; - lv_style_copy(&pr, &rel); - pr.body.main_color = LV_COLOR_HEX(0x505050); - pr.body.grad_color = pr.body.main_color; - pr.body.shadow.width = 0; + lv_style_copy(&pr, &rel); + pr.body.main_color = LV_COLOR_HEX(0x505050); + pr.body.grad_color = pr.body.main_color; + pr.body.shadow.width = 0; pr.body.border.color = COLOR_HOS_TEAL_LIGHTER; - pr.text.color = COLOR_HOS_TURQUOISE; + pr.text.color = COLOR_HOS_TURQUOISE; pr.body.border.width = 4; - lv_style_copy(&tgl_rel, &rel); + lv_style_copy(&tgl_rel, &rel); tgl_rel.body.border.color = COLOR_HOS_TEAL_LIGHTER; tgl_rel.body.border.width = 4; - lv_style_copy(&tgl_pr, &tgl_rel); - tgl_pr.body.main_color = LV_COLOR_HEX(0x505050); - tgl_pr.body.grad_color = tgl_pr.body.main_color; + lv_style_copy(&tgl_pr, &tgl_rel); + tgl_pr.body.main_color = LV_COLOR_HEX(0x505050); + tgl_pr.body.grad_color = tgl_pr.body.main_color; tgl_pr.text.color = COLOR_HOS_TURQUOISE; tgl_pr.body.shadow.width = 0; - lv_style_copy(&ina, &rel); + lv_style_copy(&ina, &rel); ina.body.main_color = LV_COLOR_HEX(0x1B1B1B); - ina.body.grad_color = ina.body.main_color; - //ina.body.shadow.width = 0; - ina.text.color = LV_COLOR_HEX(0x888888); + ina.body.grad_color = ina.body.main_color; + //ina.body.shadow.width = 0; + ina.text.color = LV_COLOR_HEX(0x888888); ina.body.border.width = 4; - theme.btn.rel = &rel; - theme.btn.pr = ≺ - theme.btn.tgl_rel = &tgl_rel; - theme.btn.tgl_pr = &tgl_pr; - theme.btn.ina = &ina; + theme.btn.rel = &rel; + theme.btn.pr = ≺ + theme.btn.tgl_rel = &tgl_rel; + theme.btn.tgl_pr = &tgl_pr; + theme.btn.ina = &ina; #endif } @@ -177,140 +176,139 @@ static void btn_init(void) static void label_init(void) { #if USE_LV_LABEL != 0 - static lv_style_t prim, sec, hint; + static lv_style_t prim, sec, hint; - lv_style_copy(&prim, &def); - prim.text.font = _font; + lv_style_copy(&prim, &def); + prim.text.font = _font; prim.text.color = COLOR_HOS_TXT_WHITE; - lv_style_copy(&sec, &prim); + lv_style_copy(&sec, &prim); sec.text.color = LV_COLOR_HEX(0xFF5500); - lv_style_copy(&hint, &prim); - hint.text.color = LV_COLOR_HEX3(0xCCC); + lv_style_copy(&hint, &prim); + hint.text.color = LV_COLOR_HEX3(0xCCC); - theme.label.prim = &prim; - theme.label.sec = &sec; - theme.label.hint = &hint; + theme.label.prim = &prim; + theme.label.sec = &sec; + theme.label.hint = &hint; #endif } static void img_init(void) { #if USE_LV_IMG != 0 - static lv_style_t img_light, img_dark; - lv_style_copy(&img_light, &def); + static lv_style_t img_light, img_dark; + lv_style_copy(&img_light, &def); img_light.image.color = LV_COLOR_HEX(0xffffff); - img_light.image.intense = LV_OPA_80; + img_light.image.intense = LV_OPA_80; - lv_style_copy(&img_dark, &def); + lv_style_copy(&img_dark, &def); img_dark.image.color = LV_COLOR_HEX(0x1B1B1B); - img_dark.image.intense = LV_OPA_80; + img_dark.image.intense = LV_OPA_80; - theme.img.light = &def; - theme.img.dark = &def; + theme.img.light = &def; + theme.img.dark = &def; #endif } static void line_init(void) { #if USE_LV_LINE != 0 - static lv_style_t line; - lv_style_copy(&line, &def); - line.line.color = LV_COLOR_HEX(0x656565); - theme.line.decor = &line; + static lv_style_t line; + lv_style_copy(&line, &def); + line.line.color = LV_COLOR_HEX(0x656565); + theme.line.decor = &line; #endif } static void led_init(void) { #if USE_LV_LED != 0 - static lv_style_t led; - lv_style_copy(&led, &def); - led.body.shadow.width = LV_DPI / 10; - led.body.radius = LV_RADIUS_CIRCLE; - led.body.border.width = LV_DPI / 30; - led.body.border.opa = LV_OPA_30; - led.body.main_color = lv_color_hsv_to_rgb(_hue, 100, 100); - led.body.grad_color = lv_color_hsv_to_rgb(_hue, 100, 100); - led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60); - led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100); + static lv_style_t led; + lv_style_copy(&led, &def); + led.body.shadow.width = LV_DPI / 10; + led.body.radius = LV_RADIUS_CIRCLE; + led.body.border.width = LV_DPI / 30; + led.body.border.opa = LV_OPA_30; + led.body.main_color = lv_color_hsv_to_rgb(_hue, 100, 100); + led.body.grad_color = lv_color_hsv_to_rgb(_hue, 100, 100); + led.body.border.color = lv_color_hsv_to_rgb(_hue, 60, 60); + led.body.shadow.color = lv_color_hsv_to_rgb(_hue, 100, 100); - - theme.led = &led; + theme.led = &led; #endif } static void bar_init(void) { #if USE_LV_BAR - static lv_style_t bar_bg, bar_indic; + static lv_style_t bar_bg, bar_indic; - lv_style_copy(&bar_bg, &def); + lv_style_copy(&bar_bg, &def); bar_bg.body.main_color = LV_COLOR_HEX(0x4D4D4D); - bar_bg.body.grad_color = bar_bg.body.main_color; - bar_bg.body.radius = 3; - bar_bg.body.border.width = 0; - bar_bg.body.padding.hor = LV_DPI / 12; - bar_bg.body.padding.ver = LV_DPI / 12; + bar_bg.body.grad_color = bar_bg.body.main_color; + bar_bg.body.radius = 3; + bar_bg.body.border.width = 0; + bar_bg.body.padding.hor = LV_DPI / 12; + bar_bg.body.padding.ver = LV_DPI / 12; - lv_style_copy(&bar_indic, &bar_bg); - bar_indic.body.main_color = COLOR_HOS_TURQUOISE; - bar_indic.body.grad_color = bar_indic.body.main_color; - bar_indic.body.padding.hor = 0; - bar_indic.body.padding.ver = 0; + lv_style_copy(&bar_indic, &bar_bg); + bar_indic.body.main_color = COLOR_HOS_TURQUOISE; + bar_indic.body.grad_color = bar_indic.body.main_color; + bar_indic.body.padding.hor = 0; + bar_indic.body.padding.ver = 0; - theme.bar.bg = &bar_bg; - theme.bar.indic = &bar_indic; + theme.bar.bg = &bar_bg; + theme.bar.indic = &bar_indic; #endif } static void slider_init(void) { #if USE_LV_SLIDER != 0 - static lv_style_t knob; - static lv_style_t slide_bar; + static lv_style_t knob; + static lv_style_t slide_bar; - lv_style_copy(&knob, &def); - knob.body.radius = LV_RADIUS_CIRCLE; - knob.body.border.width = 0; - knob.body.main_color = theme.bar.indic->body.main_color; - knob.body.grad_color = knob.body.main_color; + lv_style_copy(&knob, &def); + knob.body.radius = LV_RADIUS_CIRCLE; + knob.body.border.width = 0; + knob.body.main_color = theme.bar.indic->body.main_color; + knob.body.grad_color = knob.body.main_color; - lv_style_copy(&slide_bar, theme.bar.indic); - slide_bar.body.main_color = COLOR_HOS_TEAL_LIGHT; - slide_bar.body.grad_color = slide_bar.body.main_color; + lv_style_copy(&slide_bar, theme.bar.indic); + slide_bar.body.main_color = COLOR_HOS_TEAL_LIGHT; + slide_bar.body.grad_color = slide_bar.body.main_color; - theme.slider.bg = theme.bar.bg; - theme.slider.indic = &slide_bar; - theme.slider.knob = &knob; + theme.slider.bg = theme.bar.bg; + theme.slider.indic = &slide_bar; + theme.slider.knob = &knob; #endif } static void sw_init(void) { #if USE_LV_SW != 0 - static lv_style_t sw_bg, sw_indic, sw_knob_off, sw_knob_on; - lv_style_copy(&sw_bg, theme.slider.bg); - sw_bg.body.radius = LV_RADIUS_CIRCLE; + static lv_style_t sw_bg, sw_indic, sw_knob_off, sw_knob_on; + lv_style_copy(&sw_bg, theme.slider.bg); + sw_bg.body.radius = LV_RADIUS_CIRCLE; - lv_style_copy(&sw_indic, theme.slider.bg); - sw_indic.body.radius = LV_RADIUS_CIRCLE; + lv_style_copy(&sw_indic, theme.slider.bg); + sw_indic.body.radius = LV_RADIUS_CIRCLE; - lv_style_copy(&sw_knob_on, theme.slider.knob); + lv_style_copy(&sw_knob_on, theme.slider.knob); - lv_style_copy(&sw_knob_off, &sw_knob_on); - sw_knob_off.body.main_color = LV_COLOR_HEX(0xDADADA); - sw_knob_off.body.grad_color = sw_knob_off.body.main_color; - sw_knob_off.body.border.width = 1; - sw_knob_off.body.border.color = LV_COLOR_HEX3(0x999); - sw_knob_off.body.border.opa = LV_OPA_COVER; + lv_style_copy(&sw_knob_off, &sw_knob_on); + sw_knob_off.body.main_color = LV_COLOR_HEX(0xDADADA); + sw_knob_off.body.grad_color = sw_knob_off.body.main_color; + sw_knob_off.body.border.width = 1; + sw_knob_off.body.border.color = LV_COLOR_HEX3(0x999); + sw_knob_off.body.border.opa = LV_OPA_COVER; - theme.sw.bg = &sw_bg; - theme.sw.indic = &sw_indic; - theme.sw.knob_off = &sw_knob_off; - theme.sw.knob_on = &sw_knob_on; + theme.sw.bg = &sw_bg; + theme.sw.indic = &sw_indic; + theme.sw.knob_off = &sw_knob_off; + theme.sw.knob_on = &sw_knob_on; #endif } @@ -318,15 +316,15 @@ static void sw_init(void) static void lmeter_init(void) { #if USE_LV_LMETER != 0 - static lv_style_t lmeter; - lv_style_copy(&lmeter, &def); - lmeter.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 90); - lmeter.body.grad_color = lmeter.body.main_color; - lmeter.body.padding.hor = LV_DPI / 10; /*Scale line length*/ - lmeter.line.color = LV_COLOR_HEX3(0x999); - lmeter.line.width = 2; + static lv_style_t lmeter; + lv_style_copy(&lmeter, &def); + lmeter.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 90); + lmeter.body.grad_color = lmeter.body.main_color; + lmeter.body.padding.hor = LV_DPI / 10; // Scale line length. + lmeter.line.color = LV_COLOR_HEX3(0x999); + lmeter.line.width = 2; - theme.lmeter = &lmeter; + theme.lmeter = &lmeter; #endif } @@ -334,18 +332,18 @@ static void gauge_init(void) { #if USE_LV_GAUGE != 0 - static lv_style_t gauge; - lv_style_copy(&gauge, &def); - gauge.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 60); - gauge.body.grad_color = gauge.body.main_color; - gauge.body.padding.hor = LV_DPI / 16; /*Scale line length*/ - gauge.body.padding.inner = LV_DPI / 8; - gauge.body.border.color = LV_COLOR_HEX3(0x999); - gauge.text.color = LV_COLOR_HEX3(0xddd); - gauge.line.width = 3; - gauge.line.color = lv_color_hsv_to_rgb(_hue, 95, 70); + static lv_style_t gauge; + lv_style_copy(&gauge, &def); + gauge.body.main_color = lv_color_hsv_to_rgb(_hue, 10, 60); + gauge.body.grad_color = gauge.body.main_color; + gauge.body.padding.hor = LV_DPI / 16; // Scale line length. + gauge.body.padding.inner = LV_DPI / 8; + gauge.body.border.color = LV_COLOR_HEX3(0x999); + gauge.text.color = LV_COLOR_HEX3(0xddd); + gauge.line.width = 3; + gauge.line.color = lv_color_hsv_to_rgb(_hue, 95, 70); - theme.gauge = &gauge; + theme.gauge = &gauge; #endif } @@ -353,18 +351,18 @@ static void arc_init(void) { #if USE_LV_ARC != 0 - static lv_style_t arc; - lv_style_copy(&arc, &def); - arc.line.width = 10; - arc.line.color = lv_color_hsv_to_rgb(_hue, 90, 90); + static lv_style_t arc; + lv_style_copy(&arc, &def); + arc.line.width = 10; + arc.line.color = lv_color_hsv_to_rgb(_hue, 90, 90); - /*For prelaoder*/ - arc.body.border.width = 10; - arc.body.border.color = lv_color_hsv_to_rgb(_hue, 30, 90); - arc.body.padding.hor = 0; - arc.body.padding.ver = 0; + /*For prelaoder*/ + arc.body.border.width = 10; + arc.body.border.color = lv_color_hsv_to_rgb(_hue, 30, 90); + arc.body.padding.hor = 0; + arc.body.padding.ver = 0; - theme.arc = &arc; + theme.arc = &arc; #endif } @@ -372,85 +370,85 @@ static void preload_init(void) { #if USE_LV_PRELOAD != 0 - theme.preload = theme.arc; + theme.preload = theme.arc; #endif } static void chart_init(void) { #if USE_LV_CHART - theme.chart = theme.panel; + theme.chart = theme.panel; #endif } static void calendar_init(void) { #if USE_LV_CALENDAR - static lv_style_t ina_days; - lv_style_copy(&ina_days, &def); - ina_days.text.color = lv_color_hsv_to_rgb(_hue, 0, 70); + static lv_style_t ina_days; + lv_style_copy(&ina_days, &def); + ina_days.text.color = lv_color_hsv_to_rgb(_hue, 0, 70); - static lv_style_t high_days; - lv_style_copy(&high_days, &def); - high_days.text.color = lv_color_hsv_to_rgb(_hue, 80, 90); + static lv_style_t high_days; + lv_style_copy(&high_days, &def); + high_days.text.color = lv_color_hsv_to_rgb(_hue, 80, 90); - static lv_style_t week_box; - lv_style_copy(&week_box, &def); - week_box.body.main_color = lv_color_hsv_to_rgb(_hue, 40, 100); - week_box.body.grad_color = lv_color_hsv_to_rgb(_hue, 40, 100); - week_box.body.padding.ver = LV_DPI / 20; - week_box.body.padding.hor = theme.panel->body.padding.hor; - week_box.body.border.color = theme.panel->body.border.color; - week_box.body.border.width = theme.panel->body.border.width; - week_box.body.border.part = LV_BORDER_LEFT | LV_BORDER_RIGHT; - week_box.body.radius = 0; + static lv_style_t week_box; + lv_style_copy(&week_box, &def); + week_box.body.main_color = lv_color_hsv_to_rgb(_hue, 40, 100); + week_box.body.grad_color = lv_color_hsv_to_rgb(_hue, 40, 100); + week_box.body.padding.ver = LV_DPI / 20; + week_box.body.padding.hor = theme.panel->body.padding.hor; + week_box.body.border.color = theme.panel->body.border.color; + week_box.body.border.width = theme.panel->body.border.width; + week_box.body.border.part = LV_BORDER_LEFT | LV_BORDER_RIGHT; + week_box.body.radius = 0; - static lv_style_t today_box; - lv_style_copy(&today_box, &def); - today_box.body.main_color = LV_COLOR_WHITE; - today_box.body.grad_color = LV_COLOR_WHITE; - today_box.body.padding.ver = LV_DPI / 20; - today_box.body.radius = 0; + static lv_style_t today_box; + lv_style_copy(&today_box, &def); + today_box.body.main_color = LV_COLOR_WHITE; + today_box.body.grad_color = LV_COLOR_WHITE; + today_box.body.padding.ver = LV_DPI / 20; + today_box.body.radius = 0; - theme.calendar.bg = theme.panel; - theme.calendar.header = &lv_style_transp; - theme.calendar.inactive_days = &ina_days; - theme.calendar.highlighted_days = &high_days; - theme.calendar.week_box = &week_box; - theme.calendar.today_box = &today_box; + theme.calendar.bg = theme.panel; + theme.calendar.header = &lv_style_transp; + theme.calendar.inactive_days = &ina_days; + theme.calendar.highlighted_days = &high_days; + theme.calendar.week_box = &week_box; + theme.calendar.today_box = &today_box; #endif } static void cb_init(void) { #if USE_LV_CB != 0 - static lv_style_t rel, pr, tgl_rel, tgl_pr, ina; - lv_style_copy(&rel, theme.panel); - rel.body.shadow.type = LV_SHADOW_FULL; - rel.body.shadow.width = 3; + static lv_style_t rel, pr, tgl_rel, tgl_pr, ina; + lv_style_copy(&rel, theme.panel); + rel.body.shadow.type = LV_SHADOW_FULL; + rel.body.shadow.width = 3; - lv_style_copy(&pr, &rel); - pr.body.main_color = LV_COLOR_HEX3(0xCCC); - pr.body.grad_color = pr.body.main_color; - pr.body.shadow.width = 3; + lv_style_copy(&pr, &rel); + pr.body.main_color = LV_COLOR_HEX3(0xCCC); + pr.body.grad_color = pr.body.main_color; + pr.body.shadow.width = 3; - lv_style_copy(&tgl_rel, &rel); - tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 85); - tgl_rel.body.grad_color = tgl_rel.body.main_color; - tgl_rel.body.shadow.width = 0; + lv_style_copy(&tgl_rel, &rel); + tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 85); + tgl_rel.body.grad_color = tgl_rel.body.main_color; + tgl_rel.body.shadow.width = 0; - lv_style_copy(&tgl_pr, &tgl_rel); - tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 65); - tgl_pr.body.grad_color = tgl_pr.body.main_color; + lv_style_copy(&tgl_pr, &tgl_rel); + tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 75, 65); + tgl_pr.body.grad_color = tgl_pr.body.main_color; - lv_style_copy(&ina, theme.btn.ina); + lv_style_copy(&ina, theme.btn.ina); - theme.cb.bg = &lv_style_transp; - theme.cb.box.rel = &rel; - theme.cb.box.pr = ≺ - theme.cb.box.tgl_rel = &tgl_rel; - theme.cb.box.tgl_pr = &tgl_pr; - theme.cb.box.ina = &ina; + theme.cb.bg = &lv_style_transp; + theme.cb.box.rel = &rel; + theme.cb.box.pr = ≺ + theme.cb.box.tgl_rel = &tgl_rel; + theme.cb.box.tgl_pr = &tgl_pr; + theme.cb.box.ina = &ina; #endif } @@ -458,49 +456,48 @@ static void cb_init(void) static void btnm_init(void) { #if USE_LV_BTNM - static lv_style_t bg, rel, pr, tgl_rel, tgl_pr, ina; + static lv_style_t bg, rel, pr, tgl_rel, tgl_pr, ina; - lv_style_copy(&bg, theme.panel); - bg.body.padding.hor = 0; - bg.body.padding.ver = 0; - bg.body.padding.inner = 0; - bg.text.color = LV_COLOR_HEX3(0x555); + lv_style_copy(&bg, theme.panel); + bg.body.padding.hor = 0; + bg.body.padding.ver = 0; + bg.body.padding.inner = 0; + bg.text.color = LV_COLOR_HEX3(0x555); - lv_style_copy(&rel, theme.panel); - rel.body.border.part = LV_BORDER_FULL | LV_BORDER_INTERNAL; - rel.body.border.width = 1; - rel.body.border.color = LV_COLOR_HEX3(0xBBB); - rel.body.empty = 1; - rel.body.shadow.width = 0; + lv_style_copy(&rel, theme.panel); + rel.body.border.part = LV_BORDER_FULL | LV_BORDER_INTERNAL; + rel.body.border.width = 1; + rel.body.border.color = LV_COLOR_HEX3(0xBBB); + rel.body.empty = 1; + rel.body.shadow.width = 0; - lv_style_copy(&pr, &rel); - pr.glass = 0; - pr.body.main_color = LV_COLOR_HEX3(0xDDD); - pr.body.grad_color = pr.body.main_color; - pr.body.border.width = 0; - pr.body.empty = 0; + lv_style_copy(&pr, &rel); + pr.glass = 0; + pr.body.main_color = LV_COLOR_HEX3(0xDDD); + pr.body.grad_color = pr.body.main_color; + pr.body.border.width = 0; + pr.body.empty = 0; - lv_style_copy(&tgl_rel, &pr); - tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 90, 70); - tgl_rel.body.grad_color = tgl_rel.body.main_color; - tgl_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95); + lv_style_copy(&tgl_rel, &pr); + tgl_rel.body.main_color = lv_color_hsv_to_rgb(_hue, 90, 70); + tgl_rel.body.grad_color = tgl_rel.body.main_color; + tgl_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95); + lv_style_copy(&tgl_pr, &tgl_rel); + tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 95, 65); + tgl_pr.body.grad_color = tgl_pr.body.main_color; + tgl_pr.body.border.width = 0; - lv_style_copy(&tgl_pr, &tgl_rel); - tgl_pr.body.main_color = lv_color_hsv_to_rgb(_hue, 95, 65); - tgl_pr.body.grad_color = tgl_pr.body.main_color; - tgl_pr.body.border.width = 0; + lv_style_copy(&ina, &pr); + ina.body.main_color = LV_COLOR_HEX3(0xCCC); + ina.body.grad_color = ina.body.main_color; - lv_style_copy(&ina, &pr); - ina.body.main_color = LV_COLOR_HEX3(0xCCC); - ina.body.grad_color = ina.body.main_color; - - theme.btnm.bg = &bg; - theme.btnm.btn.rel = &rel; - theme.btnm.btn.pr = ≺ - theme.btnm.btn.tgl_rel = &tgl_rel; - theme.btnm.btn.tgl_pr = &tgl_pr; - theme.btnm.btn.ina = &def; + theme.btnm.bg = &bg; + theme.btnm.btn.rel = &rel; + theme.btnm.btn.pr = ≺ + theme.btnm.btn.tgl_rel = &tgl_rel; + theme.btnm.btn.tgl_pr = &tgl_pr; + theme.btnm.btn.ina = &def; #endif } @@ -508,20 +505,20 @@ static void kb_init(void) { #if USE_LV_KB - static lv_style_t bg, rel; + static lv_style_t bg, rel; - lv_style_copy(&bg, theme.btnm.bg); - bg.text.color = LV_COLOR_HEX3(0xCCC); + lv_style_copy(&bg, theme.btnm.bg); + bg.text.color = LV_COLOR_HEX3(0xCCC); - lv_style_copy(&rel, &lv_style_transp); - rel.text.font = _font; + lv_style_copy(&rel, &lv_style_transp); + rel.text.font = _font; - theme.kb.bg = &bg; - theme.kb.btn.rel = &rel; - theme.kb.btn.pr = theme.btnm.btn.pr; - theme.kb.btn.tgl_rel = theme.btnm.btn.tgl_rel; - theme.kb.btn.tgl_pr = theme.btnm.btn.tgl_pr; - theme.kb.btn.ina = theme.btnm.btn.ina; + theme.kb.bg = &bg; + theme.kb.btn.rel = &rel; + theme.kb.btn.pr = theme.btnm.btn.pr; + theme.kb.btn.tgl_rel = theme.btnm.btn.tgl_rel; + theme.kb.btn.tgl_pr = theme.btnm.btn.tgl_pr; + theme.kb.btn.ina = theme.btnm.btn.ina; #endif } @@ -529,7 +526,7 @@ static void kb_init(void) static void mbox_init(void) { #if USE_LV_MBOX - static lv_style_t bg; + static lv_style_t bg; lv_style_copy(&bg, theme.panel); bg.body.main_color = LV_COLOR_HEX(0x464646); @@ -542,22 +539,19 @@ static void mbox_init(void) bg.body.padding.ver = LV_DPI / 4; bg.body.padding.inner = LV_DPI / 3; - - theme.mbox.bg = &bg; - theme.mbox.btn.bg = &lv_style_transp; - theme.mbox.btn.rel = theme.btn.rel; - theme.mbox.btn.pr = theme.btn.pr; + theme.mbox.bg = &bg; + theme.mbox.btn.bg = &lv_style_transp; + theme.mbox.btn.rel = theme.btn.rel; + theme.mbox.btn.pr = theme.btn.pr; #endif } static void page_init(void) { #if USE_LV_PAGE - - - theme.page.bg = theme.panel; - theme.page.scrl = &lv_style_transp; - theme.page.sb = &sb; + theme.page.bg = theme.panel; + theme.page.scrl = &lv_style_transp; + theme.page.sb = &sb; #endif } @@ -566,28 +560,28 @@ static void ta_init(void) #if USE_LV_TA static lv_style_t oneline; - lv_style_copy(&oneline, &def); - oneline.body.empty = 1; - oneline.body.radius = 0; - oneline.body.border.part = LV_BORDER_BOTTOM; - oneline.body.border.width = 3; - oneline.body.border.color = LV_COLOR_HEX3(0x555); - oneline.body.border.opa = LV_OPA_COVER; - oneline.text.color = LV_COLOR_HEX3(0x888); + lv_style_copy(&oneline, &def); + oneline.body.empty = 1; + oneline.body.radius = 0; + oneline.body.border.part = LV_BORDER_BOTTOM; + oneline.body.border.width = 3; + oneline.body.border.color = LV_COLOR_HEX3(0x555); + oneline.body.border.opa = LV_OPA_COVER; + oneline.text.color = LV_COLOR_HEX3(0x888); theme.ta.area = theme.panel; - theme.ta.oneline = &oneline; - theme.ta.cursor = NULL; /*Let library to calculate the cursor's style*/ - theme.ta.sb = &sb; + theme.ta.oneline = &oneline; + theme.ta.cursor = NULL; // Let library to calculate the cursor's style. + theme.ta.sb = &sb; #endif } static void spinbox_init(void) { #if USE_LV_SPINBOX - theme.spinbox.bg= theme.panel; - theme.spinbox.cursor = theme.ta.cursor; - theme.spinbox.sb = theme.ta.sb; + theme.spinbox.bg= theme.panel; + theme.spinbox.cursor = theme.ta.cursor; + theme.spinbox.sb = theme.ta.sb; #endif } @@ -595,218 +589,215 @@ static void list_init(void) { #if USE_LV_LIST != 0 - static lv_style_t list_bg, rel, pr, tgl_rel, tgl_pr, ina; + static lv_style_t list_bg, rel, pr, tgl_rel, tgl_pr, ina; - lv_style_copy(&list_bg, theme.panel); - list_bg.body.padding.hor = 0; - list_bg.body.padding.ver = 0; - list_bg.body.padding.inner = 0; + lv_style_copy(&list_bg, theme.panel); + list_bg.body.padding.hor = 0; + list_bg.body.padding.ver = 0; + list_bg.body.padding.inner = 0; list_bg.body.shadow.width = 0; - lv_style_copy(&rel, &lv_style_transp); - rel.body.padding.hor = LV_DPI / 8; - rel.body.padding.ver = LV_DPI / 6; - rel.body.radius = 0; - rel.body.border.color = LV_COLOR_HEX(0x444444); - rel.body.border.width = 1; - rel.body.border.part = LV_BORDER_BOTTOM; + lv_style_copy(&rel, &lv_style_transp); + rel.body.padding.hor = LV_DPI / 8; + rel.body.padding.ver = LV_DPI / 6; + rel.body.radius = 0; + rel.body.border.color = LV_COLOR_HEX(0x444444); + rel.body.border.width = 1; + rel.body.border.part = LV_BORDER_BOTTOM; - lv_style_copy(&pr, &rel); - pr.glass = 0; - pr.body.main_color = LV_COLOR_HEX(0x505050); - pr.body.grad_color = pr.body.main_color; - //pr.body.border.width = 1; - pr.body.empty = 0; - //pr.body.radius = 0; + lv_style_copy(&pr, &rel); + pr.glass = 0; + pr.body.main_color = LV_COLOR_HEX(0x505050); + pr.body.grad_color = pr.body.main_color; + //pr.body.border.width = 1; + pr.body.empty = 0; + //pr.body.radius = 0; // pr.text.font = _font; - lv_style_copy(&tgl_rel, &pr); - tgl_rel.body.main_color = COLOR_HOS_BG_LIGHT; - tgl_rel.body.grad_color = tgl_rel.body.main_color; - //tgl_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95); + lv_style_copy(&tgl_rel, &pr); + tgl_rel.body.main_color = COLOR_HOS_BG_LIGHT; + tgl_rel.body.grad_color = tgl_rel.body.main_color; + //tgl_rel.text.color = lv_color_hsv_to_rgb(_hue, 5, 95); tgl_rel.text.color = COLOR_HOS_TEAL_LIGHTER; - lv_style_copy(&tgl_pr, &tgl_rel); - tgl_pr.body.main_color = LV_COLOR_HEX(0x505050); - tgl_pr.body.grad_color = tgl_pr.body.main_color; - tgl_pr.body.border.width = 0; + lv_style_copy(&tgl_pr, &tgl_rel); + tgl_pr.body.main_color = LV_COLOR_HEX(0x505050); + tgl_pr.body.grad_color = tgl_pr.body.main_color; + tgl_pr.body.border.width = 0; - lv_style_copy(&ina, &pr); + lv_style_copy(&ina, &pr); ina.body.main_color = LV_COLOR_HEX(0x1B1B1B); - ina.body.grad_color = ina.body.main_color; + ina.body.grad_color = ina.body.main_color; - - theme.list.sb = &sb; - theme.list.bg = &list_bg; - theme.list.scrl = &lv_style_transp_tight; - theme.list.btn.rel = &rel; - theme.list.btn.pr = ≺ - theme.list.btn.tgl_rel = &tgl_rel; - theme.list.btn.tgl_pr = &tgl_pr; - theme.list.btn.ina = &ina; + theme.list.sb = &sb; + theme.list.bg = &list_bg; + theme.list.scrl = &lv_style_transp_tight; + theme.list.btn.rel = &rel; + theme.list.btn.pr = ≺ + theme.list.btn.tgl_rel = &tgl_rel; + theme.list.btn.tgl_pr = &tgl_pr; + theme.list.btn.ina = &ina; #endif } static void ddlist_init(void) { #if USE_LV_DDLIST != 0 - static lv_style_t bg, sel; - lv_style_copy(&bg, theme.panel); - bg.body.padding.hor = LV_DPI / 6; - //bg.body.padding.ver = LV_DPI / 6; + static lv_style_t bg, sel; + lv_style_copy(&bg, theme.panel); + bg.body.padding.hor = LV_DPI / 6; + //bg.body.padding.ver = LV_DPI / 6; bg.body.radius = 0; bg.body.shadow.width = 0; bg.body.border.width = 0; - bg.text.line_space = LV_DPI / 8; + bg.text.line_space = LV_DPI / 8; bg.text.color = COLOR_HOS_TURQUOISE; - - lv_style_copy(&sel, &bg); - sel.body.main_color = COLOR_HOS_BG_LIGHT; - sel.body.grad_color = sel.body.main_color; - theme.ddlist.bg = &bg; + lv_style_copy(&sel, &bg); + sel.body.main_color = COLOR_HOS_BG_LIGHT; + sel.body.grad_color = sel.body.main_color; + + theme.ddlist.bg = &bg; theme.ddlist.bgo = &bg; theme.ddlist.pr = &sel; - theme.ddlist.sel = &sel; - theme.ddlist.sb = &sb; + theme.ddlist.sel = &sel; + theme.ddlist.sb = &sb; #endif } static void roller_init(void) { #if USE_LV_ROLLER != 0 - static lv_style_t roller_bg, roller_sel; + static lv_style_t roller_bg, roller_sel; - lv_style_copy(&roller_bg, &lv_style_transp); - roller_bg.body.padding.hor = LV_DPI / 6; - roller_bg.body.padding.ver = LV_DPI / 6; - roller_bg.text.line_space = LV_DPI / 8; - roller_bg.text.font = _font; - roller_bg.glass = 0; - roller_bg.text.color = LV_COLOR_HEX3(0x444); + lv_style_copy(&roller_bg, &lv_style_transp); + roller_bg.body.padding.hor = LV_DPI / 6; + roller_bg.body.padding.ver = LV_DPI / 6; + roller_bg.text.line_space = LV_DPI / 8; + roller_bg.text.font = _font; + roller_bg.glass = 0; + roller_bg.text.color = LV_COLOR_HEX3(0x444); - lv_style_copy(&roller_sel, &roller_bg); - roller_sel.text.color = COLOR_HOS_TURQUOISE; + lv_style_copy(&roller_sel, &roller_bg); + roller_sel.text.color = COLOR_HOS_TURQUOISE; - - theme.roller.bg = &roller_bg; - theme.roller.sel = &roller_sel; + theme.roller.bg = &roller_bg; + theme.roller.sel = &roller_sel; #endif } static void tabview_init(void) { #if USE_LV_TABVIEW != 0 - static lv_style_t indic, btn_bg, rel, pr, tgl_rel, tgl_pr; + static lv_style_t indic, btn_bg, rel, pr, tgl_rel, tgl_pr; - lv_style_copy(&indic, &def); - indic.body.main_color = COLOR_HOS_TURQUOISE; - indic.body.grad_color = indic.body.main_color; - indic.body.radius = 0; - indic.body.border.width = 0; - indic.body.padding.inner = LV_DPI / 20; + lv_style_copy(&indic, &def); + indic.body.main_color = COLOR_HOS_TURQUOISE; + indic.body.grad_color = indic.body.main_color; + indic.body.radius = 0; + indic.body.border.width = 0; + indic.body.padding.inner = LV_DPI / 20; indic.body.opa = LV_OPA_0; - lv_style_copy(&btn_bg, &def); + lv_style_copy(&btn_bg, &def); btn_bg.body.main_color = COLOR_HOS_BG; - btn_bg.body.grad_color = btn_bg.body.main_color; - btn_bg.body.radius = 0; + btn_bg.body.grad_color = btn_bg.body.main_color; + btn_bg.body.radius = 0; btn_bg.body.empty = 1; btn_bg.body.border.width = 0; - btn_bg.body.border.color = LV_COLOR_HEX3(0xDDD); - btn_bg.body.border.part = LV_BORDER_BOTTOM; - btn_bg.body.border.opa = LV_OPA_COVER; + btn_bg.body.border.color = LV_COLOR_HEX3(0xDDD); + btn_bg.body.border.part = LV_BORDER_BOTTOM; + btn_bg.body.border.opa = LV_OPA_COVER; btn_bg.body.shadow.width = 0; - btn_bg.body.shadow.color = COLOR_SHADOW_LIGHT; - btn_bg.body.shadow.type = LV_SHADOW_BOTTOM; - btn_bg.body.padding.inner = 0; - btn_bg.body.padding.hor = 0; - btn_bg.body.padding.ver = 0; - btn_bg.text.color = COLOR_HOS_TXT_WHITE; + btn_bg.body.shadow.color = COLOR_SHADOW_LIGHT; + btn_bg.body.shadow.type = LV_SHADOW_BOTTOM; + btn_bg.body.padding.inner = 0; + btn_bg.body.padding.hor = 0; + btn_bg.body.padding.ver = 0; + btn_bg.text.color = COLOR_HOS_TXT_WHITE; - lv_style_copy(&rel, &lv_style_transp); - rel.body.padding.ver = LV_DPI * 4 / 23; - rel.text.font = _font; + lv_style_copy(&rel, &lv_style_transp); + rel.body.padding.ver = LV_DPI * 4 / 23; + rel.text.font = _font; - lv_style_copy(&pr, &def); - pr.body.main_color = COLOR_HOS_BG_LIGHT; - pr.body.grad_color = pr.body.main_color; - pr.body.border.width = 0; - pr.body.empty = 0; - pr.body.radius = 0; - pr.body.border.color = LV_COLOR_HEX3(0x888); - pr.body.border.part = LV_BORDER_BOTTOM; - pr.body.border.opa = LV_OPA_COVER; - pr.text.color = COLOR_HOS_TURQUOISE; + lv_style_copy(&pr, &def); + pr.body.main_color = COLOR_HOS_BG_LIGHT; + pr.body.grad_color = pr.body.main_color; + pr.body.border.width = 0; + pr.body.empty = 0; + pr.body.radius = 0; + pr.body.border.color = LV_COLOR_HEX3(0x888); + pr.body.border.part = LV_BORDER_BOTTOM; + pr.body.border.opa = LV_OPA_COVER; + pr.text.color = COLOR_HOS_TURQUOISE; - lv_style_copy(&tgl_rel, &lv_style_transp); - tgl_rel.glass = 0; - tgl_rel.text.font = _font; - tgl_rel.text.color = COLOR_HOS_TURQUOISE; + lv_style_copy(&tgl_rel, &lv_style_transp); + tgl_rel.glass = 0; + tgl_rel.text.font = _font; + tgl_rel.text.color = COLOR_HOS_TURQUOISE; - lv_style_copy(&tgl_pr, &def); - tgl_pr.body.main_color = COLOR_HOS_BG_LIGHT; - tgl_pr.body.grad_color = tgl_pr.body.main_color; - tgl_pr.body.border.width = 0; - tgl_pr.body.empty = 0; - tgl_pr.body.radius = 0; - tgl_pr.text.color = COLOR_HOS_TURQUOISE; + lv_style_copy(&tgl_pr, &def); + tgl_pr.body.main_color = COLOR_HOS_BG_LIGHT; + tgl_pr.body.grad_color = tgl_pr.body.main_color; + tgl_pr.body.border.width = 0; + tgl_pr.body.empty = 0; + tgl_pr.body.radius = 0; + tgl_pr.text.color = COLOR_HOS_TURQUOISE; - theme.tabview.bg = theme.bg; - theme.tabview.indic = &indic; - theme.tabview.btn.bg = &btn_bg; - theme.tabview.btn.rel = &rel; - theme.tabview.btn.pr = ≺ - theme.tabview.btn.tgl_rel = &tgl_rel; - theme.tabview.btn.tgl_pr = &tgl_pr; + theme.tabview.bg = theme.bg; + theme.tabview.indic = &indic; + theme.tabview.btn.bg = &btn_bg; + theme.tabview.btn.rel = &rel; + theme.tabview.btn.pr = ≺ + theme.tabview.btn.tgl_rel = &tgl_rel; + theme.tabview.btn.tgl_pr = &tgl_pr; #endif } static void tileview_init(void) { #if USE_LV_TILEVIEW != 0 - theme.tileview.bg = &lv_style_transp_tight; - theme.tileview.scrl = &lv_style_transp_tight; - theme.tileview.sb = theme.page.sb; + theme.tileview.bg = &lv_style_transp_tight; + theme.tileview.scrl = &lv_style_transp_tight; + theme.tileview.sb = theme.page.sb; #endif } static void table_init(void) { #if USE_LV_TABLE != 0 - static lv_style_t cell; - lv_style_copy(&cell, theme.panel); - cell.body.radius = 0; - cell.body.border.width = 1; - cell.body.padding.hor = LV_DPI / 12; - cell.body.padding.ver = LV_DPI / 12; + static lv_style_t cell; + lv_style_copy(&cell, theme.panel); + cell.body.radius = 0; + cell.body.border.width = 1; + cell.body.padding.hor = LV_DPI / 12; + cell.body.padding.ver = LV_DPI / 12; - - theme.table.bg = &lv_style_transp_tight; - theme.table.cell = &cell; + theme.table.bg = &lv_style_transp_tight; + theme.table.cell = &cell; #endif } static void win_init(void) { #if USE_LV_WIN != 0 - static lv_style_t header, rel, pr; + static lv_style_t header, rel, pr; - lv_style_copy(&header, &def); + lv_style_copy(&header, &def); header.body.main_color = COLOR_HOS_BG; - header.body.grad_color = header.body.main_color; - header.body.radius = 0; - header.body.border.width = 0; - header.body.border.color = LV_COLOR_HEX3(0xDDD); - header.body.border.part = LV_BORDER_BOTTOM; - header.body.border.opa = LV_OPA_COVER; + header.body.grad_color = header.body.main_color; + header.body.radius = 0; + header.body.border.width = 0; + header.body.border.color = LV_COLOR_HEX3(0xDDD); + header.body.border.part = LV_BORDER_BOTTOM; + header.body.border.opa = LV_OPA_COVER; header.body.shadow.width = 0; header.body.shadow.color = COLOR_SHADOW_LIGHT; header.body.shadow.type = LV_SHADOW_BOTTOM; - header.body.padding.inner = 0; - header.body.padding.hor = 8; - header.body.padding.ver = 0; - //header.text.color = COLOR_HOS_TXT_WHITE; + header.body.padding.inner = 0; + header.body.padding.hor = 8; + header.body.padding.ver = 0; + //header.text.color = COLOR_HOS_TXT_WHITE; lv_style_copy(&rel, theme.btn.rel); rel.body.radius = 0; @@ -817,13 +808,13 @@ static void win_init(void) pr.body.radius = 0; pr.body.border.width = 0; - theme.win.bg = theme.panel; - theme.win.sb = &sb; - theme.win.header = &header; - theme.win.content.bg = &lv_style_transp; - theme.win.content.scrl = &lv_style_transp; - theme.win.btn.rel = &rel; - theme.win.btn.pr = ≺ + theme.win.bg = theme.panel; + theme.win.sb = &sb; + theme.win.header = &header; + theme.win.content.bg = &lv_style_transp; + theme.win.content.scrl = &lv_style_transp; + theme.win.btn.rel = &rel; + theme.win.btn.pr = ≺ #endif } @@ -841,51 +832,51 @@ static void win_init(void) */ lv_theme_t * lv_theme_hekate_init(uint16_t hue, lv_font_t * font) { - if(font == NULL) font = LV_FONT_DEFAULT; + if(font == NULL) font = LV_FONT_DEFAULT; - _hue = hue; - _font = font; + _hue = hue; + _font = font; - /*For backward compatibility initialize all theme elements with a default style */ - uint16_t i; - lv_style_t ** style_p = (lv_style_t **) &theme; - for(i = 0; i < sizeof(lv_theme_t) / sizeof(lv_style_t *); i++) { - *style_p = &def; - style_p++; - } + /*For backward compatibility initialize all theme elements with a default style */ + uint16_t i; + lv_style_t ** style_p = (lv_style_t **) &theme; + for(i = 0; i < sizeof(lv_theme_t) / sizeof(lv_style_t *); i++) { + *style_p = &def; + style_p++; + } - basic_init(); - cont_init(); - btn_init(); - label_init(); - img_init(); - line_init(); - led_init(); - bar_init(); - slider_init(); - sw_init(); - lmeter_init(); - gauge_init(); - chart_init(); - arc_init(); - preload_init(); - calendar_init(); - cb_init(); - btnm_init(); - kb_init(); - mbox_init(); - page_init(); - ta_init(); - spinbox_init(); - list_init(); - ddlist_init(); - roller_init(); - tabview_init(); - tileview_init(); - table_init(); - win_init(); + basic_init(); + cont_init(); + btn_init(); + label_init(); + img_init(); + line_init(); + led_init(); + bar_init(); + slider_init(); + sw_init(); + lmeter_init(); + gauge_init(); + chart_init(); + arc_init(); + preload_init(); + calendar_init(); + cb_init(); + btnm_init(); + kb_init(); + mbox_init(); + page_init(); + ta_init(); + spinbox_init(); + list_init(); + ddlist_init(); + roller_init(); + tabview_init(); + tileview_init(); + table_init(); + win_init(); - return &theme; + return &theme; } /** @@ -894,7 +885,7 @@ lv_theme_t * lv_theme_hekate_init(uint16_t hue, lv_font_t * font) */ lv_theme_t * lv_theme_get_hekate(void) { - return &theme; + return &theme; } /********************** diff --git a/nyx/nyx_gui/mem/mtc_table.h b/nyx/nyx_gui/mem/mtc_table.h index 7f18232..38a3e2f 100644 --- a/nyx/nyx_gui/mem/mtc_table.h +++ b/nyx/nyx_gui/mem/mtc_table.h @@ -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; diff --git a/nyx/nyx_gui/mem/sdram_lp0_param_t210.h b/nyx/nyx_gui/mem/sdram_lp0_param_t210.h index 7f44f1d..9028990 100644 --- a/nyx/nyx_gui/mem/sdram_lp0_param_t210.h +++ b/nyx/nyx_gui/mem/sdram_lp0_param_t210.h @@ -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, diff --git a/nyx/nyx_gui/nyx.c b/nyx/nyx_gui/nyx.c index 0edc321..59a3adf 100644 --- a/nyx/nyx_gui/nyx.c +++ b/nyx/nyx_gui/nyx.c @@ -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); diff --git a/nyx/nyx_gui/power/bq24193.c b/nyx/nyx_gui/power/bq24193.c index ed1b022..0f01aef 100644 --- a/nyx/nyx_gui/power/bq24193.c +++ b/nyx/nyx_gui/power/bq24193.c @@ -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; diff --git a/nyx/nyx_gui/power/bq24193.h b/nyx/nyx_gui/power/bq24193.h index 9c7b74e..34e9fbf 100644 --- a/nyx/nyx_gui/power/bq24193.h +++ b/nyx/nyx_gui/power/bq24193.h @@ -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, diff --git a/nyx/nyx_gui/power/max17050.c b/nyx/nyx_gui/power/max17050.c index 70d4fd9..4fe05e0 100644 --- a/nyx/nyx_gui/power/max17050.c +++ b/nyx/nyx_gui/power/max17050.c @@ -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 - * 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; diff --git a/nyx/nyx_gui/power/max17050.h b/nyx/nyx_gui/power/max17050.h index 2196b80..e4c8acf 100644 --- a/nyx/nyx_gui/power/max17050.h +++ b/nyx/nyx_gui/power/max17050.h @@ -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 - * 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 diff --git a/nyx/nyx_gui/power/max77620.h b/nyx/nyx_gui/power/max77620.h index 479661d..435d55c 100644 --- a/nyx/nyx_gui/power/max77620.h +++ b/nyx/nyx_gui/power/max77620.h @@ -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 diff --git a/nyx/nyx_gui/rtc/max77620-rtc.c b/nyx/nyx_gui/rtc/max77620-rtc.c index 7e2d3af..e214363 100644 --- a/nyx/nyx_gui/rtc/max77620-rtc.c +++ b/nyx/nyx_gui/rtc/max77620-rtc.c @@ -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; diff --git a/nyx/nyx_gui/sec/se_t210.h b/nyx/nyx_gui/sec/se_t210.h index 760527d..72ceb24 100644 --- a/nyx/nyx_gui/sec/se_t210.h +++ b/nyx/nyx_gui/sec/se_t210.h @@ -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 diff --git a/nyx/nyx_gui/sec/tsec.c b/nyx/nyx_gui/sec/tsec.c index 06120e1..28ecafa 100644 --- a/nyx/nyx_gui/sec/tsec.c +++ b/nyx/nyx_gui/sec/tsec.c @@ -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++) diff --git a/nyx/nyx_gui/soc/fuse.c b/nyx/nyx_gui/soc/fuse.c index 4704abb..e5273cd 100644 --- a/nyx/nyx_gui/soc/fuse.c +++ b/nyx/nyx_gui/soc/fuse.c @@ -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++) { diff --git a/nyx/nyx_gui/soc/hw_init.c b/nyx/nyx_gui/soc/hw_init.c index eb8e33d..d2f38c6 100644 --- a/nyx/nyx_gui/soc/hw_init.c +++ b/nyx/nyx_gui/soc/hw_init.c @@ -30,7 +30,6 @@ extern sdmmc_t sd_sdmmc; - void reconfig_hw_workaround(bool extra_reconfig, u32 magic) { // Flush and disable MMU. diff --git a/nyx/nyx_gui/soc/pinmux.h b/nyx/nyx_gui/soc/pinmux.h index 2db4a75..bb4ecb1 100644 --- a/nyx/nyx_gui/soc/pinmux.h +++ b/nyx/nyx_gui/soc/pinmux.h @@ -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) diff --git a/nyx/nyx_gui/soc/t210.h b/nyx/nyx_gui/soc/t210.h index 2f7fadd..ea83dbc 100644 --- a/nyx/nyx_gui/soc/t210.h +++ b/nyx/nyx_gui/soc/t210.h @@ -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. */ diff --git a/nyx/nyx_gui/soc/uart.c b/nyx/nyx_gui/soc/uart.c index 056f864..63a6bcd 100644 --- a/nyx/nyx_gui/soc/uart.c +++ b/nyx/nyx_gui/soc/uart.c @@ -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; diff --git a/nyx/nyx_gui/storage/sd.h b/nyx/nyx_gui/storage/sd.h index c3bf82b..0c680c4 100644 --- a/nyx/nyx_gui/storage/sd.h +++ b/nyx/nyx_gui/storage/sd.h @@ -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 diff --git a/nyx/nyx_gui/storage/sdmmc.c b/nyx/nyx_gui/storage/sdmmc.c index d471883..db149d8 100644 --- a/nyx/nyx_gui/storage/sdmmc.c +++ b/nyx/nyx_gui/storage/sdmmc.c @@ -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(); diff --git a/nyx/nyx_gui/storage/sdmmc.h b/nyx/nyx_gui/storage/sdmmc.h index fdc2bbb..c8b8f96 100644 --- a/nyx/nyx_gui/storage/sdmmc.h +++ b/nyx/nyx_gui/storage/sdmmc.h @@ -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, diff --git a/nyx/nyx_gui/storage/sdmmc_driver.c b/nyx/nyx_gui/storage/sdmmc_driver.c index 0c0c2ff..4709541 100644 --- a/nyx/nyx_gui/storage/sdmmc_driver.c +++ b/nyx/nyx_gui/storage/sdmmc_driver.c @@ -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; diff --git a/nyx/nyx_gui/utils/btn.c b/nyx/nyx_gui/utils/btn.c index f0a8ffc..63a983a 100644 --- a/nyx/nyx_gui/utils/btn.c +++ b/nyx/nyx_gui/utils/btn.c @@ -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, diff --git a/nyx/nyx_gui/utils/btn.h b/nyx/nyx_gui/utils/btn.h index ede13ac..8394a52 100644 --- a/nyx/nyx_gui/utils/btn.h +++ b/nyx/nyx_gui/utils/btn.h @@ -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, diff --git a/nyx/nyx_gui/utils/dirlist.c b/nyx/nyx_gui/utils/dirlist.c index 6d443bf..28aa580 100644 --- a/nyx/nyx_gui/utils/dirlist.c +++ b/nyx/nyx_gui/utils/dirlist.c @@ -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); diff --git a/nyx/nyx_gui/utils/util.c b/nyx/nyx_gui/utils/util.c index 102ebeb..e99467d 100644 --- a/nyx/nyx_gui/utils/util.c +++ b/nyx/nyx_gui/utils/util.c @@ -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); } diff --git a/nyx/nyx_gui/utils/util.h b/nyx/nyx_gui/utils/util.h index 3a81e55..f257b7c 100644 --- a/nyx/nyx_gui/utils/util.h +++ b/nyx/nyx_gui/utils/util.h @@ -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,