diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index 87798ab788..9f9db5fdef 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -96,7 +96,6 @@ endif() # Add ESP-additions source files list(APPEND srcs - "esp_additions/freertos_compatibility.c" "esp_additions/idf_additions_event_groups.c" "esp_additions/idf_additions.c") diff --git a/components/freertos/esp_additions/freertos_compatibility.c b/components/freertos/esp_additions/freertos_compatibility.c deleted file mode 100644 index d56ae4e2d5..0000000000 --- a/components/freertos/esp_additions/freertos_compatibility.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/* - * FreeRTOS has changed some functions in to macros (and vice-versa) over multiple - * releases. This is not a breaking API change for source code, but may cause issues - * for pre-compiled libraries that call these removed APIs. - * - * This file maintains these legacy APIs until the next ESP-IDF major release. - * - * Todo: Clean up for ESP-IDF v6.0 (IDF-8144) - */ - -#include "FreeRTOS.h" -#include "queue.h" -#include "semphr.h" - -BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, - void * const pvBuffer, - TickType_t xTicksToWait, - const BaseType_t xPeek ) -{ - if( xPeek == pdTRUE ) - { - return xQueuePeek( xQueue, pvBuffer, xTicksToWait ); - } - - if( pvBuffer == NULL ) - { - return xQueueSemaphoreTake( xQueue, xTicksToWait ); - } - - return xQueueReceive( xQueue, pvBuffer, xTicksToWait ); -} - -/* - * vTaskDelayUntil() was deprecated into a macro and replaced by xTaskDelayUntil(). - * This is added for pre-compiled libraries that depend on ulTaskNotifyTake() - * being a function. - * - * Todo: Remove this in v6.0 (IDF-3851) - */ -#undef vTaskDelayUntil -void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, - const TickType_t xTimeIncrement ) -{ - xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); -} - -/* - * ulTaskNotifyTake() was turned into a macro. This is added for pre-compiled - * libraries that depend on ulTaskNotifyTake() being a function. - * - * Todo: Remove this in v6.0 (IDF-3851) - */ -#undef ulTaskNotifyTake -uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, - TickType_t xTicksToWait ) -{ - return ulTaskGenericNotifyTake( tskDEFAULT_INDEX_TO_NOTIFY, xClearCountOnExit, xTicksToWait ); -} - -/* - * xTaskNotifyWait() was turned into a macro. This is added for pre-compiled - * libraries that depend on xTaskNotifyWait() being a function. - * - * Todo: Remove this in v6.0 (IDF-3851) - */ -#undef xTaskNotifyWait -BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, - uint32_t ulBitsToClearOnExit, - uint32_t * pulNotificationValue, - TickType_t xTicksToWait ) -{ - return xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ); -} diff --git a/components/freertos/linker_common.lf b/components/freertos/linker_common.lf index a1fbd96beb..1bc90f5d97 100644 --- a/components/freertos/linker_common.lf +++ b/components/freertos/linker_common.lf @@ -56,12 +56,6 @@ entries: tasks:vTaskGetSnapshot (default) - # ------------------------------------------------------------------------------------------------------------------ - # freertos_compatibility.c - # Placement Rules: Functions always in flash as they are never called from an ISR - # ------------------------------------------------------------------------------------------------------------------ - freertos_compatibility (default) - # ------------------------------------------------------------------------------------------------------------------ # idf_additions.c # Placement Rules: Functions always in flash as they are never called from an ISR diff --git a/docs/en/migration-guides/release-6.x/6.0/system.rst b/docs/en/migration-guides/release-6.x/6.0/system.rst index 74479a069a..f3c8be8d08 100644 --- a/docs/en/migration-guides/release-6.x/6.0/system.rst +++ b/docs/en/migration-guides/release-6.x/6.0/system.rst @@ -92,6 +92,13 @@ The following deprecated FreeRTOS functions have been removed in ESP-IDF v6.0: - :cpp:func:`xTaskGetIdleTaskHandleForCPU` – Use :cpp:func:`xTaskGetIdleTaskHandleForCore` instead. - :cpp:func:`xTaskGetCurrentTaskHandleForCPU` – Use :cpp:func:`xTaskGetCurrentTaskHandleForCore` instead. +The following compatibility functions have been removed in ESP-IDF v6.0. These functions were maintained for backward compatibility with previous ESP-IDF versions as they were changed to either macros or separate functions in FreeRTOS. This compatibility has been removed. + +- :cpp:func:`xQueueGenericReceive` - Use :cpp:func:`xQueueReceive`, :cpp:func:`xQueuePeek`, or :cpp:func:`xQueueSemaphoreTake` instead, depending on your use case. +- :cpp:func:`vTaskDelayUntil` - Use :cpp:func:`xTaskDelayUntil` instead +- :cpp:func:`ulTaskNotifyTake` - Use the macro ``ulTaskNotifyTake`` instead +- :cpp:func:`xTaskNotifyWait` - Use the macro ``xTaskNotifyWait`` instead + **Deprecated Functions** The function :cpp:func:`pxTaskGetStackStart` has been deprecated. Use :cpp:func:`xTaskGetStackStart` instead for improved type safety. diff --git a/docs/zh_CN/migration-guides/release-6.x/6.0/system.rst b/docs/zh_CN/migration-guides/release-6.x/6.0/system.rst index 36946f40a2..3e831d809c 100644 --- a/docs/zh_CN/migration-guides/release-6.x/6.0/system.rst +++ b/docs/zh_CN/migration-guides/release-6.x/6.0/system.rst @@ -92,6 +92,13 @@ FreeRTOS - :cpp:func:`xTaskGetIdleTaskHandleForCPU` – 请使用 :cpp:func:`xTaskGetIdleTaskHandleForCore` 替代。 - :cpp:func:`xTaskGetCurrentTaskHandleForCPU` – 请使用 :cpp:func:`xTaskGetCurrentTaskHandleForCore` 替代。 +以下兼容性函数已在 ESP-IDF v6.0 中移除。这些函数原本是为了向后兼容旧版本 ESP-IDF 而维护的,因为它们在 FreeRTOS 中已被更改为宏或独立函数。现已移除此兼容性支持。 + +- :cpp:func:`xQueueGenericReceive` - 请根据具体使用场景选择 :cpp:func:`xQueueReceive`、:cpp:func:`xQueuePeek` 或 :cpp:func:`xQueueSemaphoreTake` 替代 +- :cpp:func:`vTaskDelayUntil` - 请使用 :cpp:func:`xTaskDelayUntil` 替代 +- :cpp:func:`ulTaskNotifyTake` - 请使用宏 ``ulTaskNotifyTake`` 替代 +- :cpp:func:`xTaskNotifyWait` - 请使用宏 ``xTaskNotifyWait`` 替代 + **已弃用的函数** 函数 :cpp:func:`pxTaskGetStackStart` 已弃用。请使用 :cpp:func:`xTaskGetStackStart` 替代以提高类型安全性。 diff --git a/tools/idf_py_actions/hints.yml b/tools/idf_py_actions/hints.yml index 6a4e0cb8c6..f9f0e6855b 100644 --- a/tools/idf_py_actions/hints.yml +++ b/tools/idf_py_actions/hints.yml @@ -526,3 +526,20 @@ - re: undefined reference to `i3c_new_master_bus' hint: "The I3C master driver is not fully supported in IDF. To use this driver please enable `IDF_EXPERIMENTAL_FEATURES`" + +- + re: "error: implicit declaration of function '{}'" + hint: "The FreeRTOS compatibility function '{}' has been removed in ESP-IDF v6.0. Please use {} instead." + variables: + - + re_variables: ['xQueueGenericReceive'] + hint_variables: ['xQueueGenericReceive', 'xQueueReceive(), xQueuePeek(), or xQueueSemaphoreTake() depending on your use case'] + - + re_variables: ['vTaskDelayUntil'] + hint_variables: ['vTaskDelayUntil', 'xTaskDelayUntil'] + - + re_variables: ['ulTaskNotifyTake'] + hint_variables: ['ulTaskNotifyTake', 'the macro ulTaskNotifyTake'] + - + re_variables: ['xTaskNotifyWait'] + hint_variables: ['xTaskNotifyWait', 'the macro xTaskNotifyWait']