From 7b41d6004af4b975ddaca2bfac5170fededead38 Mon Sep 17 00:00:00 2001 From: Darian Leung Date: Fri, 7 Apr 2023 01:32:44 +0800 Subject: [PATCH] freertos: Fix idf_additions.h include order error When building for CONFIG_FREERTOS_SMP, "idf_additions.h" was previously implicitly included by "task.h" so that other ESP-IDF components still have access to IDF API additions without needing to include "idf_additions.h" directly. However, some FreeRTOS headers (e.g., queue.h) will include task.h before declaring any types (e.g., QueueHandle_t). Thus if any of those types are used in idf_additions.h, we get a missing type error. This commit moves the implicity include of idf_additions.h to FreeRTOS.h --- .../FreeRTOS-Kernel-SMP/include/freertos/FreeRTOS.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/FreeRTOS.h b/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/FreeRTOS.h index 60abd75b6c..b25b7bd330 100644 --- a/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/FreeRTOS.h +++ b/components/freertos/FreeRTOS-Kernel-SMP/include/freertos/FreeRTOS.h @@ -1391,4 +1391,11 @@ typedef StaticStreamBuffer_t StaticMessageBuffer_t; #endif /* *INDENT-ON* */ +/* IDF API additions have been moved to idf_additions.h when building for + * Amazon SMP FreeRTOS. However, the rest of ESP-IDF has not been updated to + * include this header explicitly when calling this additional API. Thus, we + * include this here as a workaround until the rest of ESP-IDF can be updated + * to include idf_additions.h explicitly. */ +#include "freertos/idf_additions.h" + #endif /* INC_FREERTOS_H */