From 560579781689c62656f680b35d6d218be38f8d21 Mon Sep 17 00:00:00 2001 From: Alessio Caiazza Date: Sat, 20 Nov 2021 00:17:40 +0100 Subject: [PATCH] Never store a brightness level of 0 Enforce a minimum brightness level to prevent booting with a black screen Related to https://github.com/OpenRTX/OpenRTX/issues/50 --- openrtx/src/state.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openrtx/src/state.c b/openrtx/src/state.c index 6b0ef7b7..5522c56d 100644 --- a/openrtx/src/state.c +++ b/openrtx/src/state.c @@ -88,6 +88,14 @@ void state_init() void state_terminate() { + /* + * Never store a brightness of 0 to avoid booting with a black screen + */ + if(state.settings.brightness == 0) + { + state.settings.brightness = 25; + } + nvm_writeSettingsAndVfo(&state.settings, &state.channel); }