stop OLED powering on every message if connected to phone

Cette révision appartient à :
liquidraver
2025-11-03 21:25:31 +01:00
Parent 5b4544b9fe
révision 397d280c3b
2 fichiers modifiés avec 16 ajouts et 2 suppressions
+8 -1
Voir le fichier
@@ -596,9 +596,16 @@ 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(); // Only turn on display if it's off AND not connected to phone via BLE
// If connected to phone, user will see messages there, so don't wake the OLED
if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
// Always extend auto-off timer and trigger refresh if display is on
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
}
} }
} }
+8 -1
Voir le fichier
@@ -136,9 +136,16 @@ 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(); // Only turn on display if it's off AND not connected to phone via BLE
// If connected to phone, user will see messages there, so don't wake the OLED
if (!_display->isOn() && !hasConnection()) {
_display->turnOn();
}
// Always extend auto-off timer and trigger refresh if display is on
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;
}
} }
} }