From 69235b70609b8c014def8a362909233b7b370729 Mon Sep 17 00:00:00 2001 From: copercini Date: Thu, 8 Mar 2018 10:07:46 -0300 Subject: [PATCH] Put the task in blocking mode when there is no items in queue --- src/AsyncTCP.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/AsyncTCP.cpp b/src/AsyncTCP.cpp index 7a98f8e..57e222f 100644 --- a/src/AsyncTCP.cpp +++ b/src/AsyncTCP.cpp @@ -91,11 +91,9 @@ static void _handle_async_event(lwip_event_packet_t * e){ static void _async_service_task(void *pvParameters){ lwip_event_packet_t * packet = NULL; for (;;) { - if(xQueueReceive(_async_queue, &packet, 0) == pdTRUE){ + if(xQueueReceive(_async_queue, &packet, portMAX_DELAY) == pdTRUE){ //dispatch packet _handle_async_event(packet); - } else { - vTaskDelay(1); } } vTaskDelete(NULL);