mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-02 10:16:11 +00:00
Merge pull request #2643 from disq/companion-display-keep-on-when-powered
companion_radio: Add optional `KEEP_DISPLAY_ON_USB` flag to keep display on while powered 🤖🤖
This commit is contained in:
@@ -809,6 +809,15 @@ void UITask::loop() {
|
|||||||
_display->endFrame();
|
_display->endFrame();
|
||||||
}
|
}
|
||||||
#if AUTO_OFF_MILLIS > 0
|
#if AUTO_OFF_MILLIS > 0
|
||||||
|
#ifdef KEEP_DISPLAY_ON_USB
|
||||||
|
// Opt-in: refresh the auto-off deadline while externally powered, so the
|
||||||
|
// timer counts from the moment external power is removed. Off by default
|
||||||
|
// because OLED panels burn in quickly; only enable for LCD targets or
|
||||||
|
// where the display is replaceable.
|
||||||
|
if (board.isExternalPowered()) {
|
||||||
|
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (millis() > _auto_off) {
|
if (millis() > _auto_off) {
|
||||||
_display->turnOff();
|
_display->turnOff();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -342,6 +342,15 @@ void UITask::loop() {
|
|||||||
|
|
||||||
_next_refresh = millis() + 1000; // refresh every second
|
_next_refresh = millis() + 1000; // refresh every second
|
||||||
}
|
}
|
||||||
|
#ifdef KEEP_DISPLAY_ON_USB
|
||||||
|
// Opt-in: refresh the auto-off deadline while externally powered, so the
|
||||||
|
// timer counts from the moment external power is removed. Off by default
|
||||||
|
// because OLED panels burn in quickly; only enable for LCD targets or
|
||||||
|
// where the display is replaceable.
|
||||||
|
if (board.isExternalPowered()) {
|
||||||
|
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (millis() > _auto_off) {
|
if (millis() > _auto_off) {
|
||||||
_display->turnOff();
|
_display->turnOff();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -704,6 +704,15 @@ void UITask::loop() {
|
|||||||
_display->endFrame();
|
_display->endFrame();
|
||||||
}
|
}
|
||||||
#if AUTO_OFF_MILLIS > 0
|
#if AUTO_OFF_MILLIS > 0
|
||||||
|
#ifdef KEEP_DISPLAY_ON_USB
|
||||||
|
// Opt-in: refresh the auto-off deadline while externally powered, so the
|
||||||
|
// timer counts from the moment external power is removed. Off by default
|
||||||
|
// because OLED panels burn in quickly; only enable for LCD targets or
|
||||||
|
// where the display is replaceable.
|
||||||
|
if (board.isExternalPowered()) {
|
||||||
|
_auto_off = millis() + AUTO_OFF_MILLIS;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if (millis() > _auto_off) {
|
if (millis() > _auto_off) {
|
||||||
_display->turnOff();
|
_display->turnOff();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user