refactor(freertos/idf): Implicitly include idf_additions.h from FreeRTOS.h

This commit adds an implicit inclusion of `idf_additions.h` to `FreeRTOS.h` in
preparation for moving some IDf specific API to `idf_additions.h`.

This implict inclusion allows existing code to be continue using these
relocated APIs without any changes in header inclusions.

Also removed "#pragma once" directive from "freertos_tasks_c_additions.h" since
that header is included as a source file.
This commit is contained in:
Darian Leung 2023-08-29 16:48:30 +08:00
parent b4cc451321
commit 5227616e57
4 changed files with 50 additions and 11 deletions

View File

@ -1393,11 +1393,29 @@ 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"
/*-----------------------------------------------------------
* IDF Compatibility
*----------------------------------------------------------*/
#ifdef ESP_PLATFORM
/*
* Include ESP-IDF API additions implicitly for compatibility reasons.
*
* ESP-IDF API additions were previously added directly to FreeRTOS headers
* (e.g., task.h, queue.h). These APIs have now been moved to
* idf_additions.h.
*
* To ensure there are no breaking changes, we include idf_additions.h
* implicitly here so that those API additions are still accessible. Given
* that FreeRTOS.h must be included first before calling any FreeRTOS API,
* any existing source code can continue using these relocated APIs without
* any additional header inclusions via this implicit inclusion.
*
* Todo: Deprecate this implicit inclusion by ESP-IDF v6.0 (IDF-8126)
*/
#include "freertos/idf_additions.h"
#endif /* ESP_PLATFORM */
#endif /* INC_FREERTOS_H */

View File

@ -3321,8 +3321,6 @@ core 0 during startup.
void vTaskStartSchedulerOtherCores( void );
#endif // configNUM_CORES > 1
#include "freertos/idf_additions.h"
#endif //ESP_PLATFORM
/* *INDENT-OFF* */

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*
* SPDX-FileContributor: 2016-2022 Espressif Systems (Shanghai) CO LTD
* SPDX-FileContributor: 2016-2023 Espressif Systems (Shanghai) CO LTD
*/
/*
@ -1404,4 +1404,29 @@ typedef StaticStreamBuffer_t StaticMessageBuffer_t;
#endif
/* *INDENT-ON* */
/*-----------------------------------------------------------
* IDF Compatibility
*----------------------------------------------------------*/
#ifdef ESP_PLATFORM
/*
* Include ESP-IDF API additions implicitly for compatibility reasons.
*
* ESP-IDF API additions were previously added directly to FreeRTOS headers
* (e.g., task.h, queue.h). These APIs have now been moved to
* idf_additions.h.
*
* To ensure there are no breaking changes, we include idf_additions.h
* implicitly here so that those API additions are still accessible. Given
* that FreeRTOS.h must be included first before calling any FreeRTOS API,
* any existing source code can continue using these relocated APIs without
* any additional header inclusions via this implicit inclusion.
*
* Todo: Deprecate this implicit inclusion by ESP-IDF v6.0 (IDF-8126)
*/
#include "freertos/idf_additions.h"
#endif /* ESP_PLATFORM */
#endif /* INC_FREERTOS_H */

View File

@ -4,8 +4,6 @@
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include "sdkconfig.h"
#include "freertos/idf_additions.h"
#if CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT