Hi, why the task function
static void example_espnow_task(void *pvParameter) {....}
in the espnow_example_main.c doesn't have an infinite loop inside?
As I understand, according to FreeRTOS documentation, all task functions must be implemented with the infinite loop and never return.
espnow example in esp-idf/examples/wifi/espnow
-
- Posts: 6
- Joined: Sun Apr 11, 2021 6:34 pm
-
- Posts: 9766
- Joined: Thu Nov 26, 2015 4:08 am
Re: espnow example in esp-idf/examples/wifi/espnow
The infinite loop is here:
xQueueReceive will return pdTRUE if there's an event and pdFALSE if there is a timeout. However, as the timeout period is set to portMAX_DELAY, there will never be a timeout, and as such the loop is essentially infinite.
Code: Select all
while (xQueueReceive(s_example_espnow_queue, &evt, portMAX_DELAY) == pdTRUE)
Who is online
Users browsing this forum: Baidu [Spider], Majestic-12 [Bot] and 137 guests