| 12345678910111213 |
- void deepSleep() {
- hideProgress(); // Make sure the LEDs are turned off
- debug("Milliseconds awake: %d", millis() - wakeTime);
- int64_t sleepTimeMillis = SLEEP_TIME_MS - (millis() - wakeTime);
-
- debug("Going to sleep for: %d milliseconds", sleepTimeMillis);
- // Do it again to account for the time the serial printing might take.
- sleepTimeMillis = SLEEP_TIME_MS - (millis() - wakeTime);
- esp_sleep_enable_timer_wakeup(sleepTimeMillis * 1000);
- esp_deep_sleep_start();
- }
|