From 32def14d8362a97aa4a0b4ea7fffd26d36158bdc Mon Sep 17 00:00:00 2001 From: Correl Date: Tue, 31 Jan 2023 16:06:30 -0500 Subject: [PATCH] Revert "Use light sleep to save battery in tracker" This reverts commit b4273f4bdff4af432af8bd40d91a20f2233103d0. --- src/main.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index b5dc44c..d09116e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -418,7 +418,6 @@ public: } M5.Display.endWrite(); - sleep(); } App::Choices loop () { @@ -456,25 +455,9 @@ public: next_clock_update = next_minute(current_time); drawClock(current_time); drawBattery(); - } else { - sleep(); } return App::LifeTracker; } - - void sleep() { - const time_t current_time = time(nullptr); - if (current_time >= next_clock_update) return; - - int seconds = next_clock_update - current_time; - esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW); // Wake on touch - esp_sleep_enable_ext0_wakeup(GPIO_NUM_37, LOW); // Wake on button up - esp_sleep_enable_ext0_wakeup(GPIO_NUM_38, LOW); // Wake on button middle - esp_sleep_enable_ext0_wakeup(GPIO_NUM_39, LOW); // Wake on button down - esp_sleep_enable_timer_wakeup(seconds * 1000); // Wake up at the next clock update (in microseconds) - esp_light_sleep_start(); - } - void shutdown() { }