From b71fb1f12a0a5ca85fc97ed04d34db20411e2454 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 20 Sep 2025 23:47:51 -0400 Subject: [PATCH] misc: Fix some build warnings with gcc9 ata-creativezen looks like a legit memory-trashing bug, the rtc fixes are bitwise inversion of a bool, and the remaining are just unused static variables. Change-Id: I1a818d4839cd3a54ca6e85f26feb743a4a9d29dc --- apps/keymaps/keymap-ypr1.c | 4 ++-- firmware/drivers/rtc/rtc_e8564.c | 2 +- firmware/drivers/rtc/rtc_s35380a.c | 2 +- .../target/arm/tms320dm320/creative-zvm/ata-creativezvm.c | 4 ++-- .../target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c | 6 +++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/keymaps/keymap-ypr1.c b/apps/keymaps/keymap-ypr1.c index 67f42f07c6..64a9399a73 100644 --- a/apps/keymaps/keymap-ypr1.c +++ b/apps/keymaps/keymap-ypr1.c @@ -99,7 +99,7 @@ static const struct button_mapping button_context_settings_right_is_inc[] = { static const struct button_mapping button_context_yesno[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_STD) }; /* button_context_settings_yesno */ - +#if 0 static const struct button_mapping button_context_colorchooser[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), }; /* button_context_colorchooser */ @@ -107,7 +107,7 @@ static const struct button_mapping button_context_colorchooser[] = { static const struct button_mapping button_context_eq[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_CUSTOM|CONTEXT_SETTINGS), }; /* button_context_eq */ - +#endif /** Bookmark Screen **/ static const struct button_mapping button_context_bmark[] = { LAST_ITEM_IN_LIST__NEXTLIST(CONTEXT_LIST), diff --git a/firmware/drivers/rtc/rtc_e8564.c b/firmware/drivers/rtc/rtc_e8564.c index 775ff86728..7bd90fe2a3 100644 --- a/firmware/drivers/rtc/rtc_e8564.c +++ b/firmware/drivers/rtc/rtc_e8564.c @@ -195,7 +195,7 @@ bool rtc_check_alarm_started(bool release_alarm) if (run_before) { started = alarm_state; - alarm_state &= ~release_alarm; + alarm_state &= !release_alarm; } else { diff --git a/firmware/drivers/rtc/rtc_s35380a.c b/firmware/drivers/rtc/rtc_s35380a.c index 6deaed6354..23f3c229e9 100644 --- a/firmware/drivers/rtc/rtc_s35380a.c +++ b/firmware/drivers/rtc/rtc_s35380a.c @@ -301,7 +301,7 @@ bool rtc_check_alarm_started(bool release_alarm) if (run_before) { rc = int_flag; - int_flag &= ~release_alarm; + int_flag &= !release_alarm; } else { diff --git a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c index 76929e603e..6936a24873 100644 --- a/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c +++ b/firmware/target/arm/tms320dm320/creative-zvm/ata-creativezvm.c @@ -263,7 +263,7 @@ static void cfs_init(void) /* Read root inode's first sector */ _ata_read_sectors(CFS_CLUSTER2CLUSTER(root_inode->first_class_chain[0]), 64, §or2); root_direntry = (struct cfs_direntry*)§or2; - root_direntry_items = (struct cfs_direntry_item*)(§or2+sizeof(struct cfs_direntry)); + root_direntry_items = (struct cfs_direntry_item*)(§or2[0]+sizeof(struct cfs_direntry)); logf("0x%x", root_direntry->identifier); @@ -291,7 +291,7 @@ static void cfs_init(void) /* Read VFAT inode's first sector */ _ata_read_sectors(CFS_CLUSTER2CLUSTER(vfat_inode->first_class_chain[0]), 64, §or2); vfat_direntry = (struct cfs_direntry*)§or2; - vfat_direntry_items = (struct cfs_direntry_item*)(§or2+sizeof(struct cfs_direntry)); + vfat_direntry_items = (struct cfs_direntry_item*)(§or2[0]+sizeof(struct cfs_direntry)); /* Search for VFAT's subinodes */ for(i=0; i < vfat_direntry->items; i++) diff --git a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c index cad1a13cd7..f6ece28635 100644 --- a/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c +++ b/firmware/target/mips/ingenic_x1000/erosqnative/lcd-erosqnative.c @@ -1,4 +1,3 @@ - /*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ @@ -30,6 +29,7 @@ /* for reference on these command/data hex values, see the mipi dcs lcd spec. * * Not everything here is there, but all the standard stuff is. */ + /* New Display Eroq 2.1 / Hifiwalker 1.7+ / Surfans v3.2, unknown Controller * * (partially GC9A01 register compatible) * * https://espruino.microcosm.app/api/v1/files/ \ * @@ -39,6 +39,7 @@ * Init sequence From 'EROS Q (c口)_V2.1_20231209固件.zip' * * update.upt/.iso -> In 'uboot.bin' at 0x52da0-0x5305f * * http://www.eroshifi.com/download/firmware/122.html */ +#if !defined(BOOTLOADER) || (EROSQN_VER >= 3) static const uint32_t erosqnative_lcd_cmd_enable_v3[] = { /* Unlock EXTC? */ @@ -154,7 +155,9 @@ static const uint32_t erosqnative_lcd_cmd_enable_v3[] = { LCD_INSTR_UDELAY, 20000, LCD_INSTR_END, }; +#endif +#if !defined(BOOTLOADER) || (EROSQN_VER < 3) /* Original Display / Hifiwalker -1.5 / Surfans -2.7 */ static const uint32_t erosqnative_lcd_cmd_enable_v1[] = { /* Set EXTC? */ @@ -228,6 +231,7 @@ static const uint32_t erosqnative_lcd_cmd_enable_v1[] = { LCD_INSTR_UDELAY, 20000, LCD_INSTR_END, }; +#endif static const uint32_t erosqnative_lcd_of_compat_cmd[] = { /* Pixel Format Set */