From 43c59a7c672c2f77eb95a2f83f50b55dda36988e Mon Sep 17 00:00:00 2001 From: Marcus Kida Date: Mon, 6 Jul 2026 12:56:33 +0200 Subject: [PATCH] Screen dimming: dim backlight to a fraction of brightness when idle Add an optional "Screen Dim" setting (Display Options) that, in Auto backlight mode, dims the screen to a fraction of the configured brightness after the backlight timeout instead of going to the off level. Any activity restores full brightness. - Setting values: Off / 100% / 50% / 30%, stored in two spare option bits (no settingsStruct change, no version bump; existing codeplugs default to Off). - display.c: displayGetIdleBacklightPercentage() computes the idle level. - applicationMain.c: the idle-timeout tick dims to that level; an incoming signal (hasSignal) re-triggers full brightness so RX keeps the screen lit. TX already forces full brightness. - menuDisplayOptions.c: new entry with a hardcoded English label (no language files touched). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../application/include/user_interface/uiGlobals.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MDUV380_firmware/application/include/user_interface/uiGlobals.h b/MDUV380_firmware/application/include/user_interface/uiGlobals.h index db22aad..2c24dfd 100644 --- a/MDUV380_firmware/application/include/user_interface/uiGlobals.h +++ b/MDUV380_firmware/application/include/user_interface/uiGlobals.h @@ -121,7 +121,10 @@ typedef uint32_t time_t_custom; /* date/time in unix secs past 1-Jan-70 */ #define DISPLAY_Y_POS_MENU_ENTRY_HIGHLIGHT (32 + DISPLAY_V_OFFSET) #endif #define DISPLAY_Y_POS_BAR 10 -#define DISPLAY_Y_POS_CONTACT (16 + 8) +// Extra gap below the S-meter/label row before the top info strip (contact/TG, +// CTCSS/DCS, squelch). Tune this one number to adjust the padding. +#define DISPLAY_MAIN_CONTENT_TOP_PAD 4 +#define DISPLAY_Y_POS_CONTACT (16 + 8 + DISPLAY_MAIN_CONTENT_TOP_PAD) #define DISPLAY_Y_POS_CONTACT_TX (34 + DISPLAY_V_OFFSET) #define DISPLAY_Y_POS_CONTACT_TX_FRAME (34 + DISPLAY_V_OFFSET) #if defined(PLATFORM_VARIANT_DM1701) @@ -131,8 +134,8 @@ typedef uint32_t time_t_custom; /* date/time in unix secs past 1-Jan-70 */ #endif #define DISPLAY_Y_POS_CHANNEL_SECOND_LINE (48 + 48 - DISPLAY_Y_OFFSET) #define DISPLAY_Y_POS_SQUELCH_BAR 16 -#define DISPLAY_Y_POS_CSS_INFO (16 + 8) -#define DISPLAY_Y_POS_SQL_INFO (25 + 8) +#define DISPLAY_Y_POS_CSS_INFO (16 + 8 + DISPLAY_MAIN_CONTENT_TOP_PAD) +#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)