diff --git a/ESPGeiger/src/OLEDDisplay/OLEDDisplay.h b/ESPGeiger/src/OLEDDisplay/OLEDDisplay.h index a53f8b7..1617065 100644 --- a/ESPGeiger/src/OLEDDisplay/OLEDDisplay.h +++ b/ESPGeiger/src/OLEDDisplay/OLEDDisplay.h @@ -134,6 +134,7 @@ class SSD1306Display : public SSD1306Wire{ void loop() { unsigned long now = millis(); if (now - _last_update > 500) { +#ifdef GEIGER_PUSHBUTTON if ((_lcd_timeout > 0) && (now - status.oled_timeout > _lcd_timeout)) { if (status.oled_on) { clear(); @@ -144,6 +145,7 @@ class SSD1306Display : public SSD1306Wire{ } else { status.oled_on = true; } +#endif _last_update = now; if (status.oled_page == 1) { if ((now - status.oled_last_update > 10000) || (status.oled_last_update == 0)) { @@ -258,11 +260,7 @@ class SSD1306Display : public SSD1306Wire{ uint8_t fontWidth, fontHeight; unsigned long _last_update = 0; unsigned long _last_full = 0; -#ifdef GEIGER_PUSHBUTTON unsigned long _lcd_timeout = 60000; -#else - unsigned long _lcd_timeout = 0; -#endif }; #endif