Group Flight logbook toggle with other switches, real screen-off on timeout
Moves "Flight logbook ON/OFF" into the group of plain on/off toggles in the Flight Options menu, right under Proximity LED, alongside the other LED-driven alerts and the ground-vehicle filter. The inactivity screen timeout (Menu > System > Timeout) now turns the backlight fully off (0) instead of just dimming it, for users who want to keep the flight logbook running without needing the screen. Night dimming (a separate setting) already covers the "just a bit darker" case and is unaffected. Tapping the screen still wakes it back up to the configured normal (or night-dimmed) brightness. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
12
src/main.cpp
12
src/main.cpp
@@ -52,7 +52,6 @@ bool wasEmergency = false;
|
||||
bool bannerBlinkOn = false;
|
||||
|
||||
constexpr uint8_t BACKLIGHT_FULL = 255;
|
||||
constexpr uint8_t BACKLIGHT_DIMMED = 12;
|
||||
constexpr uint8_t BACKLIGHT_PWM_CHANNEL = 0;
|
||||
uint32_t lastInteractionMs = 0;
|
||||
bool screenDimmed = false;
|
||||
@@ -605,7 +604,16 @@ void loop() {
|
||||
if (!screenDimmed && timeoutMin > 0) {
|
||||
uint32_t timeoutMs = (uint32_t)timeoutMin * 60000UL;
|
||||
if (nowMs - lastInteractionMs >= timeoutMs) {
|
||||
ledcWrite(BACKLIGHT_PWM_CHANNEL, min(BACKLIGHT_DIMMED, normalBacklightPwm()));
|
||||
// Bewusst ganz aus (0) statt nur gedimmt - fuer den
|
||||
// Bildschirm-Timeout (Menue > System > Timeout). Dimmen
|
||||
// uebernimmt bereits der separate Nachtmodus
|
||||
// (updateNightDimming()); der Inaktivitaets-Timeout soll das
|
||||
// Display wirklich abschalten, z.B. fuer Plane-Spotter, die nur
|
||||
// das Flugbuch mitlaufen lassen wollen, ohne den Screen zu
|
||||
// brauchen. Ein Antippen weckt ihn ueber den screenDimmed-Zweig
|
||||
// oben wieder auf die eingestellte Helligkeit (bzw. Nachtmodus-
|
||||
// Helligkeit, falls gerade Nachtstunden sind).
|
||||
ledcWrite(BACKLIGHT_PWM_CHANNEL, 0);
|
||||
screenDimmed = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user