From b4369b27307c824a7c78001aea57629a7eded69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Heath=20Dutton=F0=9F=95=B4=EF=B8=8F?= Date: Thu, 8 Jan 2026 09:04:17 -0500 Subject: [PATCH] Fix screen not sleeping due to power status updates (#9216) Co-authored-by: Ben Meadors --- src/graphics/Screen.cpp | 9 +++++++-- src/graphics/Screen.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 0012aeb5d..91a9ed593 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -1429,10 +1429,15 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg) } nodeDB->updateGUI = false; break; - case STATUS_TYPE_POWER: - forceDisplay(true); + case STATUS_TYPE_POWER: { + bool currentUSB = powerStatus->getHasUSB(); + if (currentUSB != lastPowerUSBState) { + lastPowerUSBState = currentUSB; + forceDisplay(true); + } break; } + } return 0; } diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 4bb808970..cfffc6731 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -715,6 +715,8 @@ class Screen : public concurrency::OSThread // Whether we are showing the regular screen (as opposed to booth screen or // Bluetooth PIN screen) bool showingNormalScreen = false; + /// Track USB power state to only wake screen on actual power state changes + bool lastPowerUSBState = false; // Implementation to Adjust Brightness uint8_t brightness = BRIGHTNESS_DEFAULT; // H = 254, MH = 192, ML = 130 L = 103