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:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user