From 382620a66c33712e4719e04f6dabb62fec4e208e Mon Sep 17 00:00:00 2001 From: cyberman54 Date: Sat, 2 Oct 2021 14:05:05 +0200 Subject: [PATCH] optime sleep mode --- src/reset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reset.cpp b/src/reset.cpp index 5dce2d20..f63a8454 100644 --- a/src/reset.cpp +++ b/src/reset.cpp @@ -132,7 +132,7 @@ void enter_deepsleep(const uint64_t wakeup_sec, gpio_num_t wakeup_gpio) { #if (HAS_LORA) ESP_LOGI(TAG, "Waiting until LMIC is idle..."); for (i = 100; i > 0; i--) { - if ((LMIC.opmode & OP_TXRXPEND) || + if ((LMIC.opmode & (OP_JOINING | OP_TXDATA | OP_POLL | OP_TXRXPEND)) || os_queryTimeCriticalJobs(sec2osticks(wakeup_sec))) vTaskDelay(pdMS_TO_TICKS(1000)); else