From 1f668046a0f16efdcfd4edd7d9a9c5517dd1753e Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 10 Jun 2020 18:23:20 -0700 Subject: [PATCH] if we can't sleep, at least have the processor block for 100ms --- src/PowerFSM.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/PowerFSM.cpp b/src/PowerFSM.cpp index c495cd27..aa926abd 100644 --- a/src/PowerFSM.cpp +++ b/src/PowerFSM.cpp @@ -68,7 +68,7 @@ static void lsIdle() powerFSM.trigger(EVENT_SERIAL_CONNECTED); } else { // We woke for some other reason (button press, uart, device interrupt) - //uint64_t status = esp_sleep_get_ext1_wakeup_status(); + // uint64_t status = esp_sleep_get_ext1_wakeup_status(); DEBUG_MSG("wakeCause %d\n", wakeCause); #ifdef BUTTON_PIN @@ -84,6 +84,9 @@ static void lsIdle() powerFSM.trigger(EVENT_WAKE_TIMER); } } + } else { + // Someone says we can't sleep now, so just save some power by sleeping the CPU for 100ms or so + delay(100); } } else { // Time to stop sleeping!