enter_deepsleep cleanup wait logic

This commit is contained in:
cyberman54 2020-12-29 00:21:40 +01:00
parent a0f3d89295
commit d23bc3535e

View File

@ -117,10 +117,9 @@ void enter_deepsleep(const uint64_t wakeup_sec = 60,
// wait a while (max 100 sec) to clear send queues // wait a while (max 100 sec) to clear send queues
ESP_LOGI(TAG, "Waiting until send queues are empty..."); ESP_LOGI(TAG, "Waiting until send queues are empty...");
for (i = 100; i > 0; i--) { for (i = 100; i > 0; i--) {
if (!allQueuesEmtpy()) if (allQueuesEmtpy())
vTaskDelay(pdMS_TO_TICKS(1000));
else
break; break;
vTaskDelay(pdMS_TO_TICKS(1000));
} }
// shutdown LMIC safely, waiting max 100 sec // shutdown LMIC safely, waiting max 100 sec