Skip to content

Commit

Permalink
Adjust if to wrap actual work
Browse files Browse the repository at this point in the history
  • Loading branch information
steadramon committed Oct 14, 2023
1 parent 1b8ff32 commit 4afb284
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ESPGeiger/src/OLEDDisplay/OLEDDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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)) {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4afb284

Please sign in to comment.