Don't send data if display is disconnected

Otherwise, we're waiting 1s on pretty much any call to the display. If
the display gets disconnected at the start of the `update_display()`
function, that can mean quite the delay.

It's possible that this delay triggers a watchdog timer that blinks the
LEDs, but there doesn't appear to be any watchdog timer configured.
This commit is contained in:
jvblanck
2021-07-18 18:27:47 +02:00
parent fb68e8c4d6
commit 895280cb5a
4 changed files with 18 additions and 18 deletions

View File

@ -134,7 +134,7 @@ void update_display(){
if(Stw_data.buttonState1 & Stw_data.buttonState4){
alarm("");
}
if(!tft._displaybool){
if(!tft.disconnected){
tft.cursorOn(false);
if(trcalt!=Stw_data.trc or trctimer == true or Stw_data.buttonStateEnc1 == HIGH){
display_trc();
@ -380,7 +380,7 @@ void alarm(String textstr){
textstr.toCharArray(text,7);
tft.setTextSize(8,8);
while(x==1){
if(!tft._displaybool){
if(!tft.disconnected){
tft.setTextColor(EA_BLACK,EA_RED);
tft.fillDisplayColor(EA_RED);
tft.drawText(5,68,'L',text);
@ -389,7 +389,7 @@ void alarm(String textstr){
digitalWrite(led_s[j], HIGH);
}
delay(100);
if(!tft._displaybool){
if(!tft.disconnected){
tft.setTextColor(EA_BLACK,EA_WHITE);
tft.fillDisplayColor(EA_WHITE);
tft.drawText(5,68,'L',text);