Attempt to resurrect the display after disconnect
This commit is contained in:
		@ -241,8 +241,18 @@ void update_display() {
 | 
				
			|||||||
    return;
 | 
					    return;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if (tft.disconnected) {
 | 
					  if (tft.disconnected) {
 | 
				
			||||||
 | 
					    uint32_t now = millis();
 | 
				
			||||||
 | 
					    if (now - last_cleared < 1000) {
 | 
				
			||||||
      return;
 | 
					      return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					    digitalWrite(reset, LOW);
 | 
				
			||||||
 | 
					    delay(100);
 | 
				
			||||||
 | 
					    digitalWrite(reset, HIGH);
 | 
				
			||||||
 | 
					    tft.disconnected = false;
 | 
				
			||||||
 | 
					    tft.clear();
 | 
				
			||||||
 | 
					    cleared = true;
 | 
				
			||||||
 | 
					    last_cleared = now;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (check_enc_displays()) {
 | 
					  if (check_enc_displays()) {
 | 
				
			||||||
    cleared = true;
 | 
					    cleared = true;
 | 
				
			||||||
@ -258,7 +268,6 @@ void update_display() {
 | 
				
			|||||||
    Stw_data.button4_rises = 0;
 | 
					    Stw_data.button4_rises = 0;
 | 
				
			||||||
    view = (DisplayView)((view + 1) % (VIEW_LAST + 1));
 | 
					    view = (DisplayView)((view + 1) % (VIEW_LAST + 1));
 | 
				
			||||||
    tft.clear();
 | 
					    tft.clear();
 | 
				
			||||||
    last_cleared = now;
 | 
					 | 
				
			||||||
    cleared = true;
 | 
					    cleared = true;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user