Skip to content

Commit

Permalink
Fix watchface timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
techguytechtips authored and RuffaloLavoisier committed Apr 24, 2022
1 parent 785ad5d commit d61da9d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/apps/main/switcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ void OswAppSwitcher::loop() {
}
}

if (_enableAutoSleep && *_rtcAppIndex == 0 && !hal->btnIsDown(_btn)) {
if (_enableAutoSleep && *_rtcAppIndex == 0) {
if (hal->btnIsDown(BUTTON_1) || hal->btnIsDown(BUTTON_2) || hal->btnIsDown(BUTTON_3)) {
appOnScreenSince = millis();
}
short timeout = OswConfigAllKeys::settingDisplayTimeout.get();
if (*_rtcAppIndex == 0 && (millis() - appOnScreenSince) > timeout * 1000) {
if (hal->btnIsDown(BUTTON_1) || hal->btnIsDown(BUTTON_2) || hal->btnIsDown(BUTTON_3)) {
appOnScreenSince = millis();
} else if(timeout > 0) {
Serial.print("Going to sleep after ");
Serial.print(timeout);
Serial.println(" seconds");
this->sleep();
}
if (timeout > 0 && (millis() - appOnScreenSince) > timeout * 1000) {
Serial.print("Going to sleep after ");
Serial.print(timeout);
Serial.println(" seconds");
this->sleep();

}
}

Expand Down

0 comments on commit d61da9d

Please sign in to comment.