Fix screen not sleeping due to power status updates (#9216)
Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
co-authored by
Ben Meadors
parent
6e110788fd
commit
b4369b2730
@@ -1429,10 +1429,15 @@ int Screen::handleStatusUpdate(const meshtastic::Status *arg)
|
|||||||
}
|
}
|
||||||
nodeDB->updateGUI = false;
|
nodeDB->updateGUI = false;
|
||||||
break;
|
break;
|
||||||
case STATUS_TYPE_POWER:
|
case STATUS_TYPE_POWER: {
|
||||||
forceDisplay(true);
|
bool currentUSB = powerStatus->getHasUSB();
|
||||||
|
if (currentUSB != lastPowerUSBState) {
|
||||||
|
lastPowerUSBState = currentUSB;
|
||||||
|
forceDisplay(true);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -715,6 +715,8 @@ class Screen : public concurrency::OSThread
|
|||||||
// Whether we are showing the regular screen (as opposed to booth screen or
|
// Whether we are showing the regular screen (as opposed to booth screen or
|
||||||
// Bluetooth PIN screen)
|
// Bluetooth PIN screen)
|
||||||
bool showingNormalScreen = false;
|
bool showingNormalScreen = false;
|
||||||
|
/// Track USB power state to only wake screen on actual power state changes
|
||||||
|
bool lastPowerUSBState = false;
|
||||||
|
|
||||||
// Implementation to Adjust Brightness
|
// Implementation to Adjust Brightness
|
||||||
uint8_t brightness = BRIGHTNESS_DEFAULT; // H = 254, MH = 192, ML = 130 L = 103
|
uint8_t brightness = BRIGHTNESS_DEFAULT; // H = 254, MH = 192, ML = 130 L = 103
|
||||||
|
|||||||
Reference in New Issue
Block a user