Attempt to resurrect the display after disconnect

This commit is contained in:
Jasper Blanckenburg 2022-03-17 00:11:01 +01:00
parent 1fdadd8b85
commit 1a72d6aa0f
1 changed files with 11 additions and 2 deletions

View File

@ -241,7 +241,17 @@ void update_display() {
return;
}
if (tft.disconnected) {
return;
uint32_t now = millis();
if (now - last_cleared < 1000) {
return;
}
digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
tft.disconnected = false;
tft.clear();
cleared = true;
last_cleared = now;
}
if (check_enc_displays()) {
@ -258,7 +268,6 @@ void update_display() {
Stw_data.button4_rises = 0;
view = (DisplayView)((view + 1) % (VIEW_LAST + 1));
tft.clear();
last_cleared = now;
cleared = true;
}