fix: apply saved display brightness before UI task starts

Loading... screen was always shown at full brightness because prefs
are not yet loaded at that point. Apply setBrightness() in the first
common code path after the_mesh.begin() loads prefs, so at least the
tail of the loading screen and the entire splash screen respect the
saved brightness level.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-05-16 23:15:29 +02:00
parent b91afa05b9
commit 5bc250888f

View File

@@ -219,6 +219,10 @@ void setup() {
#endif
#ifdef DISPLAY_CLASS
// Apply saved brightness as soon as prefs are available so the tail of
// the loading screen is not stuck at full brightness.
if (disp && the_mesh.getNodePrefs())
disp->setBrightness(the_mesh.getNodePrefs()->display_brightness);
ui_task.begin(disp, &sensors, the_mesh.getNodePrefs()); // still want to pass this in as dependency, as prefs might be moved
#endif