From 734b8619179159eeaf2d0ddc5092c765c5baccae Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Tue, 7 Jul 2026 15:30:23 +0200 Subject: [PATCH] 7-segment frequency: inactive segments off, fix MHz colour, +1px RX/TX gap - Inactive segments now render in the background colour (off) instead of dimmed. - The 7-seg renderer left the foreground on the last segment drawn (now the background colour), which hid MHz; re-apply the frequency theme colour before drawing MHz so it reappears and matches the digits. - Move the TX frequency line down 1px for a little more RX/TX separation. Co-Authored-By: Claude Opus 4.8 (1M context) --- CHANGELOG.md | 3 +++ .../application/include/user_interface/uiGlobals.h | 2 +- .../application/source/hardware/HX8353E_display.c | 8 +++----- .../application/source/user_interface/uiUtilities.c | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c93a1df..b056265 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ single running list until the first versioned release. ## Unreleased +- **7-segment frequency font:** inactive segments are now off (background) instead + of faintly lit — no dim "ghosting". "MHz" now matches the frequency colour, and + there's 1px more space between the RX and TX frequency lines. - **Screen dimming:** added a **15%** idle-dim level (Off / 100 / 50 / 30 / 15). - **DM-1701 build support** — the Docker build is now parameterized by platform; `./build-firmware.sh DM1701` produces `OpenDM1701.bin` (Baofeng DM-1701 / diff --git a/MDUV380_firmware/application/include/user_interface/uiGlobals.h b/MDUV380_firmware/application/include/user_interface/uiGlobals.h index 8c3ced8..a913efb 100644 --- a/MDUV380_firmware/application/include/user_interface/uiGlobals.h +++ b/MDUV380_firmware/application/include/user_interface/uiGlobals.h @@ -138,7 +138,7 @@ typedef uint32_t time_t_custom; /* date/time in unix secs past 1-Jan-70 */ #define DISPLAY_Y_POS_SQL_INFO (25 + 8 + DISPLAY_MAIN_CONTENT_TOP_PAD) #define DISPLAY_Y_POS_TX_TIMER (8 + 16) #define DISPLAY_Y_POS_RX_FREQ (40 + 40) -#define DISPLAY_Y_POS_TX_FREQ (48 + 48) +#define DISPLAY_Y_POS_TX_FREQ (48 + 48 + 1) // +1px extra gap below the RX frequency line #define DISPLAY_Y_POS_ZONE (50 + DISPLAY_V_EXTRA_PIXELS) #define DISPLAY_Y_POS_RSSI_VALUE (18 + 16) #define DISPLAY_Y_POS_RSSI_BAR (40 + DISPLAY_V_OFFSET) diff --git a/MDUV380_firmware/application/source/hardware/HX8353E_display.c b/MDUV380_firmware/application/source/hardware/HX8353E_display.c index c723a1e..a9836cb 100644 --- a/MDUV380_firmware/application/source/hardware/HX8353E_display.c +++ b/MDUV380_firmware/application/source/hardware/HX8353E_display.c @@ -1106,11 +1106,9 @@ void displayDrawFrequencySevenSeg(int16_t x, int16_t y, int16_t cellW, int16_t c uint16_t litColour = themeItems[DAYTIME_CURRENT][fgItem]; uint16_t bgColour = themeItems[DAYTIME_CURRENT][THEME_ITEM_BG]; - // dimColour: same hue at ~3/8 intensity (round-trip through RGB888) so the - // inactive segments stay clearly visible without washing out the lit ones. - uint32_t rgb = PLATFORM_COLOUR_FORMAT_TO_RGB888(__builtin_bswap16(litColour)); - uint32_t dimRgb = (((((rgb >> 16) & 0xFF) * 3) / 8) << 16) | (((((rgb >> 8) & 0xFF) * 3) / 8) << 8) | ((((rgb) & 0xFF) * 3) / 8); - uint16_t dimColour = __builtin_bswap16(RGB888_TO_PLATFORM_COLOUR_FORMAT(dimRgb)); + // Inactive segments are drawn in the background colour (i.e. off), so only the + // lit segments show (no dim "ghosting"). + uint16_t dimColour = bgColour; for (const char *p = str; *p != '\0'; p++) { diff --git a/MDUV380_firmware/application/source/user_interface/uiUtilities.c b/MDUV380_firmware/application/source/user_interface/uiUtilities.c index d01a446..72ea4b5 100644 --- a/MDUV380_firmware/application/source/user_interface/uiUtilities.c +++ b/MDUV380_firmware/application/source/user_interface/uiUtilities.c @@ -2524,6 +2524,9 @@ void uiUtilityDisplayFrequency(uint8_t y, bool isTX, bool hasFocus, uint32_t fre #else displayPrintAtDoubleHeight(FREQUENCY_X_POS, yFont3, buffer, FONT_SIZE_3, displayFocusAndDblHeight); #endif + // Re-apply the frequency colour: the 7-segment renderer leaves the foreground + // set to the last segment drawn, so "MHz" would otherwise use the wrong colour. + displayThemeApply(isTX ? THEME_ITEM_FG_TX_FREQ : THEME_ITEM_FG_RX_FREQ, THEME_ITEM_BG); displayPrintAtDoubleHeight(DISPLAY_SIZE_X - (3 * 8), yFont3, "MHz", FONT_SIZE_3, displayFocusAndDblHeight); displayThemeResetToDefault();