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

@ -77,7 +77,7 @@ double get_value(int a)
void update_display()
{
if (!tft._displaybool)
if (!tft.disconnected)
{
tft.cursorOn(false);
if (modealt != Stw_data.mode || modetimer == true)
@ -140,7 +140,7 @@ void alarm(String textstr)
tft.setTextSize(8, 8);
while (x == 1)
{
if (!tft._displaybool)
if (!tft.disconnected)
{
tft.setTextColor(EA_BLACK, EA_RED);
tft.fillDisplayColor(EA_RED);
@ -151,7 +151,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);