diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index ae79d4c..a7991d7 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -175,7 +175,7 @@ static inline bool _get_async_event(lwip_event_packet_t** e) { if (xQueueReceive(_async_queue, &next_pkt, 0) == pdPASS){ free(next_pkt); next_pkt = NULL; - log_w("coalescing polls, async callback might be too slow!"); + log_d("coalescing polls, async callback might be too slow!"); } else return true; } else @@ -259,15 +259,23 @@ static void _async_service_task(void* pvParameters) { for (;;) { if (_get_async_event(&packet)) { #if CONFIG_ASYNC_TCP_USE_WDT - if (esp_task_wdt_add(NULL) != ESP_OK) { - log_e("Failed to add async task to WDT"); + switch((size_t)packet->arg){ + case LWIP_TCP_RECV: + case LWIP_TCP_POLL: + if (esp_task_wdt_add(NULL) != ESP_OK) { + log_e("Failed to add async task to WDT"); + } + _handle_async_event(packet); + if (esp_task_wdt_delete(NULL) != ESP_OK) { + log_e("Failed to remove async task from WDT"); + } + break; + + default: + _handle_async_event(packet); } -#endif +#else _handle_async_event(packet); -#if CONFIG_ASYNC_TCP_USE_WDT - if (esp_task_wdt_delete(NULL) != ESP_OK) { - log_e("Failed to remove loop task from WDT"); - } #endif } }