Skip to content

Commit 01f7a3c

Browse files
authored
Merge pull request #1057 from liquidraver/wiodev
Disable screen switching on when connected
2 parents 441d768 + 99a3473 commit 01f7a3c

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

examples/companion_radio/ui-new/UITask.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,13 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i
631631
setCurrScreen(msg_preview);
632632

633633
if (_display != NULL) {
634-
if (!_display->isOn()) _display->turnOn();
634+
if (!_display->isOn() && !hasConnection()) {
635+
_display->turnOn();
636+
}
637+
if (_display->isOn()) {
635638
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
636639
_next_refresh = 100; // trigger refresh
640+
}
637641
}
638642
}
639643

examples/companion_radio/ui-orig/UITask.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,13 @@ void UITask::newMsg(uint8_t path_len, const char* from_name, const char* text, i
137137
StrHelper::strncpy(_msg, text, sizeof(_msg));
138138

139139
if (_display != NULL) {
140-
if (!_display->isOn()) _display->turnOn();
140+
if (!_display->isOn() && !hasConnection()) {
141+
_display->turnOn();
142+
}
143+
if (_display->isOn()) {
141144
_auto_off = millis() + AUTO_OFF_MILLIS; // extend the auto-off timer
142145
_need_refresh = true;
146+
}
143147
}
144148
}
145149

0 commit comments

Comments
 (0)