Skip to content

Commit 225910f

Browse files
jplexercodex
andcommitted
shell: configure Standard backlight intensity per board
Add BACKLIGHT_STANDARD_INTENSITY with a 1-100 range and a default of 50. Set it to 25 in the shared Getafix board configuration and use it for the Standard preset, which also supplies fresh-device brightness. Keep Standard as the default mode and preserve saved preferences. Battery Saver retains its Dim curve and other boards retain 50%. Fixes FIRM-4392 Co-Authored-By: GPT-6 Astra <noreply@openai.com> Signed-off-by: Joshua Jun <lets@throw.rocks>
1 parent 185551c commit 225910f

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

boards/getafix/defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ CONFIG_RNG=y
7474

7575

7676
CONFIG_DYNAMIC_BACKLIGHT=y
77+
CONFIG_BACKLIGHT_STANDARD_INTENSITY=25
7778
CONFIG_ACCEL_SENSITIVITY=y
7879
CONFIG_APP_SCALING=y
7980
CONFIG_ORIENTATION_MANAGER=y

src/fw/Kconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ config THEMING
1818
help
1919
Expose the highlight-color theming UI under Settings.
2020

21+
config BACKLIGHT_STANDARD_INTENSITY
22+
int "Standard backlight preset intensity (%)"
23+
range 1 100
24+
default 50
25+
help
26+
Logical brightness used by the Standard backlight preset and fresh
27+
shell preferences. The light service scales it to the board hardware
28+
maximum. Saved brightness preferences take precedence.
29+
2130
config DYNAMIC_BACKLIGHT
2231
bool "Dynamic backlight"
2332
help

src/fw/shell/normal/prefs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ static uint32_t s_backlight_timeout_ms = DEFAULT_BACKLIGHT_TIMEOUT_MS;
7676
#define BACKLIGHT_INTENSITY_MIN 1U
7777
#define BACKLIGHT_INTENSITY_MAX 100U
7878
#define BACKLIGHT_INTENSITY_MEDIUM 25U
79-
#define BACKLIGHT_INTENSITY_HIGH 50U
8079
#define BACKLIGHT_INTENSITY_DEFAULT BACKLIGHT_INTENSITY_MEDIUM
8180
static uint8_t s_backlight_intensity; // default set in shell_prefs_init()
8281

@@ -142,7 +141,7 @@ static const BacklightPresetSettings s_backlight_preset_settings[] = {
142141
#ifdef CONFIG_DYNAMIC_BACKLIGHT
143142
.dynamic_mode = BacklightDynamicMode_Standard,
144143
#endif
145-
.intensity = BACKLIGHT_INTENSITY_HIGH,
144+
.intensity = CONFIG_BACKLIGHT_STANDARD_INTENSITY,
146145
.timeout_ms = DEFAULT_BACKLIGHT_TIMEOUT_MS,
147146
.motion_enabled = true,
148147
.touch_wake = BacklightTouchWake_DoubleTap,

tests/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ add_compile_options(${PBL_TEST_C_FLAGS})
5050
set(PBL_TEST_DEFINES
5151
"CLAR_FIXTURE_PATH=\"${PBL_BASE}/tests/fixtures/\""
5252
CONFIG_LOG=1
53+
CONFIG_BACKLIGHT_STANDARD_INTENSITY=50
5354
CONFIG_KERNEL_NUM_PRIORITIES=5
5455
CONFIG_KERNEL_THREAD_TLS_SLOTS=2
5556
CONFIG_KERNEL_STACK_ALIGN=8

0 commit comments

Comments
 (0)