Add ALLOW_SLEEP flag to enable sleep mode in inactivity checks

This commit is contained in:
2026-05-28 21:35:41 +02:00
parent f15ea8190f
commit 3de6c121a5
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -16,9 +16,11 @@ bool k4_prev = HIGH;
void buttons_checkInactivity() {
uint64_t currentTime = esp_timer_get_time();
if (currentTime - lastPressedButtonTime > INACTIVITY_THRESHOLD_TIME_US && !screenOff) {
if (currentTime - lastPressedButtonTime > INACTIVITY_THRESHOLD_TIME_US && !screenOff && !alwaysOnEnabled) {
#ifdef ALLOW_SLEEP
digitalWrite(BL_PIN, LOW);
screenKey = OFF_SCREEN;
#endif
} else if (currentTime - lastPressedButtonTime > LAST_PRESSED_BUTTON_THRESHOLD_TIME_US && !inactive) {
screenKey = MAIN_SCREEN;