remove(freertos): Removed freertos_compatibility.c

The freertos_compatibility.c file has been removed and appropriate
guidelines have been added to hints.yml and the migration guide to use
alternatives for the backward compatibility functions that have been
removed.
This commit is contained in:
Sudeep Mohanty
2025-07-16 15:59:29 +02:00
parent 72cb973022
commit 471a659e84
6 changed files with 31 additions and 86 deletions

View File

@@ -96,7 +96,6 @@ endif()
# Add ESP-additions source files # Add ESP-additions source files
list(APPEND srcs list(APPEND srcs
"esp_additions/freertos_compatibility.c"
"esp_additions/idf_additions_event_groups.c" "esp_additions/idf_additions_event_groups.c"
"esp_additions/idf_additions.c") "esp_additions/idf_additions.c")

View File

@@ -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 );
}

View File

@@ -56,12 +56,6 @@ entries:
tasks:vTaskGetSnapshot (default) 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 # idf_additions.c
# Placement Rules: Functions always in flash as they are never called from an ISR # Placement Rules: Functions always in flash as they are never called from an ISR

View File

@@ -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:`xTaskGetIdleTaskHandleForCPU` Use :cpp:func:`xTaskGetIdleTaskHandleForCore` instead.
- :cpp:func:`xTaskGetCurrentTaskHandleForCPU` Use :cpp:func:`xTaskGetCurrentTaskHandleForCore` 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** **Deprecated Functions**
The function :cpp:func:`pxTaskGetStackStart` has been deprecated. Use :cpp:func:`xTaskGetStackStart` instead for improved type safety. The function :cpp:func:`pxTaskGetStackStart` has been deprecated. Use :cpp:func:`xTaskGetStackStart` instead for improved type safety.

View File

@@ -92,6 +92,13 @@ FreeRTOS
- :cpp:func:`xTaskGetIdleTaskHandleForCPU` 请使用 :cpp:func:`xTaskGetIdleTaskHandleForCore` 替代。 - :cpp:func:`xTaskGetIdleTaskHandleForCPU` 请使用 :cpp:func:`xTaskGetIdleTaskHandleForCore` 替代。
- :cpp:func:`xTaskGetCurrentTaskHandleForCPU` 请使用 :cpp:func:`xTaskGetCurrentTaskHandleForCore` 替代。 - :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` 替代以提高类型安全性。 函数 :cpp:func:`pxTaskGetStackStart` 已弃用。请使用 :cpp:func:`xTaskGetStackStart` 替代以提高类型安全性。

View File

@@ -526,3 +526,20 @@
- -
re: undefined reference to `i3c_new_master_bus' 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`" 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']