Merge pull request #1057 from liquidraver/wiodev

Disable screen switching on when connected
This commit is contained in:
fdlamotte
2025-12-04 11:10:51 +01:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -631,11 +631,15 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i
setCurrScreen(msg_preview); setCurrScreen(msg_preview);
if (_display != NULL) { if (_display != NULL) {
if (!_display->isOn()) _display->turnOn(); if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
if (_display->isOn()) {
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer _auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
_next_refresh = 100; // trigger refresh _next_refresh = 100; // trigger refresh
} }
} }
}
void UITask::userLedHandler() { void UITask::userLedHandler() {
#ifdef PIN_STATUS_LED #ifdef PIN_STATUS_LED

View File

@@ -137,11 +137,15 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i
StrHelper::strncpy(_msg, text, sizeof(_msg)); StrHelper::strncpy(_msg, text, sizeof(_msg));
if (_display != NULL) { if (_display != NULL) {
if (!_display->isOn()) _display->turnOn(); if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
if (_display->isOn()) {
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer _auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
_need_refresh = true; _need_refresh = true;
} }
} }
}
void UITask::renderBatteryIndicator(uint16_t batteryMilliVolts) { void UITask::renderBatteryIndicator(uint16_t batteryMilliVolts) {
// Convert millivolts to percentage // Convert millivolts to percentage