mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
Merge branch 'task/remove_deprecated_funcs_in_idf_additions_h' into 'master'
remove(freertos): Remove deprecated functions from idf_additions.h Closes IDF-8499, IDF-8158, and DOC-11732 See merge request espressif/esp-idf!40386
This commit is contained in:
@@ -547,15 +547,18 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask )
|
||||
#endif /* ( !CONFIG_FREERTOS_SMP && ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
||||
StackType_t * xTaskGetStackStart( TaskHandle_t xTask )
|
||||
{
|
||||
TCB_t * pxTCB;
|
||||
uint8_t * uxReturn;
|
||||
|
||||
pxTCB = prvGetTCBFromHandle( xTask );
|
||||
uxReturn = ( uint8_t * ) pxTCB->pxStack;
|
||||
return pxTCB->pxStack;
|
||||
}
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
return uxReturn;
|
||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask )
|
||||
{
|
||||
return (uint8_t *)xTaskGetStackStart( xTask );
|
||||
}
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -195,14 +195,12 @@ BaseType_t xTaskGetCoreID( TaskHandle_t xTask );
|
||||
* Returns the lowest stack memory address, regardless of whether the stack
|
||||
* grows up or down.
|
||||
*
|
||||
* [refactor-todo] Change return type to StackType_t (IDF-8158)
|
||||
*
|
||||
* @param xTask Handle of the task associated with the stack returned.
|
||||
* Set xTask to NULL to return the stack of the calling task.
|
||||
*
|
||||
* @return A pointer to the start of the stack.
|
||||
*/
|
||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask );
|
||||
StackType_t * xTaskGetStackStart( TaskHandle_t xTask );
|
||||
|
||||
/* --------------------------------------------- TLSP Deletion Callbacks -------------------------------------------- */
|
||||
|
||||
@@ -628,30 +626,14 @@ void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer,
|
||||
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION == 1 */
|
||||
|
||||
|
||||
/* --------------------------------------------------- Deprecated ------------------------------------------------------
|
||||
* Deprecated IDF FreeRTOS API additions.
|
||||
* Todo: Remove in v6.0 (IDF-8499)
|
||||
* Todo: Remove in v7.0 (IDF-13569)
|
||||
* ------------------------------------------------------------------------------------------------------------------ */
|
||||
|
||||
/** @cond */
|
||||
static inline __attribute__( ( always_inline, deprecated( "This function is deprecated and will be removed in ESP-IDF 6.0. Please use xTaskGetCoreID() instead." ) ) )
|
||||
BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
||||
{
|
||||
return xTaskGetCoreID( xTask );
|
||||
}
|
||||
|
||||
static inline __attribute__( ( always_inline, deprecated( "This function is deprecated and will be removed in ESP-IDF 6.0. Please use xTaskGetIdleTaskHandleForCore() instead." ) ) )
|
||||
TaskHandle_t xTaskGetIdleTaskHandleForCPU( BaseType_t xCoreID )
|
||||
{
|
||||
return xTaskGetIdleTaskHandleForCore( xCoreID );
|
||||
}
|
||||
uint8_t * pxTaskGetStackStart( TaskHandle_t xTask ) __attribute__((deprecated("Use xTaskGetStackStart() for improved type safety")));
|
||||
|
||||
static inline __attribute__( ( always_inline, deprecated( "This function is deprecated and will be removed in ESP-IDF 6.0. Please use xTaskGetCurrentTaskHandleForCore() instead." ) ) )
|
||||
TaskHandle_t xTaskGetCurrentTaskHandleForCPU( BaseType_t xCoreID )
|
||||
{
|
||||
return xTaskGetCurrentTaskHandleForCore( xCoreID );
|
||||
}
|
||||
/** @endcond */
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
@@ -12,6 +12,7 @@ The register names have been updated to use the ``XT_REG_`` prefix. Please use t
|
||||
|
||||
Power Management
|
||||
----------------
|
||||
|
||||
In previous versions of ESP-IDF, the API :cpp:func:`esp_sleep_get_wakeup_cause` was used to retrieve the wakeup reason after the chip exited sleep. However, this function only returns one wakeup source, even if multiple sources were triggered simultaneously, which may cause users to miss other active wakeup events.
|
||||
|
||||
Since ESP-IDF v6.0, a new API :cpp:func:`esp_sleep_get_wakeup_causes` has been introduced. This function returns a bitmap representing all wakeup sources that caused the chip to exit sleep. Each bit corresponds to a value in the :cpp:type:`esp_sleep_wakeup_cause_t` enum (e.g., ESP_SLEEP_WAKEUP_TIMER, ESP_SLEEP_WAKEUP_EXT1, etc.). Users can check each wakeup source using bitwise operations.
|
||||
@@ -46,13 +47,30 @@ Removed option for compiling bootloader with no optimization level (-O0, `CONFIG
|
||||
|
||||
Time
|
||||
----
|
||||
|
||||
The deprecated ``{IDF_TARGET_NAME}/rtc.h`` header file has been removed. Please include the replacement ``esp_rtc_time.h`` instead.
|
||||
|
||||
HW-Support
|
||||
----------
|
||||
|
||||
The deprecated ``soc_memory_types.h`` header file has been removed. Please include the replacement ``esp_memory_utils.h`` instead.
|
||||
|
||||
App Trace
|
||||
----------
|
||||
|
||||
Removed extra data buffering option. `CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX` is no longer supported.
|
||||
|
||||
FreeRTOS
|
||||
--------
|
||||
|
||||
**Removed Functions**
|
||||
|
||||
The following deprecated FreeRTOS functions have been removed in ESP-IDF v6.0:
|
||||
|
||||
- :cpp:func:`xTaskGetAffinity` – Use :cpp:func:`xTaskGetCoreID` instead.
|
||||
- :cpp:func:`xTaskGetIdleTaskHandleForCPU` – Use :cpp:func:`xTaskGetIdleTaskHandleForCore` instead.
|
||||
- :cpp:func:`xTaskGetCurrentTaskHandleForCPU` – Use :cpp:func:`xTaskGetCurrentTaskHandleForCore` instead.
|
||||
|
||||
**Deprecated Functions**
|
||||
|
||||
The function :cpp:func:`pxTaskGetStackStart` has been deprecated. Use :cpp:func:`xTaskGetStackStart` instead for improved type safety.
|
||||
|
@@ -12,9 +12,12 @@ Xtensa 特殊寄存器头文件已更新,使用新的命名约定。旧的 ``s
|
||||
|
||||
电源管理
|
||||
--------
|
||||
|
||||
在旧版本的 ESP-IDF 中,使用 :cpp:func:`esp_sleep_get_wakeup_cause` API 获取芯片从睡眠中唤醒的原因,然而,该函数在多个唤醒源同时激活的情况下,只会返回其中一个唤醒源,可能导致用户遗漏其他同时发生的唤醒条件。
|
||||
|
||||
自 v6.0 版本起,ESP-IDF 新增 :cpp:func:`esp_sleep_get_wakeup_causes` API,此函数返回一个 bitmap,表示所有触发唤醒的唤醒源。每一位对应 :cpp:type:`esp_sleep_wakeup_cause_t` 枚举中的一个值(例如 ESP_SLEEP_WAKEUP_TIMER、ESP_SLEEP_WAKEUP_EXT1 等),用户可以通过按位与操作判断是否被对应源唤醒。
|
||||
原先的 :cpp:func:`esp_sleep_get_wakeup_cause()` 函数现已标记为 已废弃(deprecated),建议用户迁移至新接口,未来版本中,该函数可能会被移除。用户可按以下示例进行迁移:
|
||||
|
||||
原先的 :cpp:func:`esp_sleep_get_wakeup_cause()` 函数现已标记为已弃用,建议用户迁移至新接口。未来版本中,该函数可能会被移除。用户可按以下示例进行迁移:
|
||||
|
||||
旧代码:
|
||||
|
||||
@@ -36,3 +39,38 @@ Xtensa 特殊寄存器头文件已更新,使用新的命名约定。旧的 ``s
|
||||
if (causes & BIT(ESP_SLEEP_WAKEUP_TIMER)) {
|
||||
handle_timer_wakeup();
|
||||
}
|
||||
|
||||
引导加载程序
|
||||
------------
|
||||
|
||||
已移除使用无优化等级 (-O0, `CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE`) 编译引导加载程序的选项。在大多数芯片上,使用 -O0 编译引导加载程序已无法成功,因为 IRAM 段会溢出。对于调试目的,推荐使用 -Og (:ref:`CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG<CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG>`) 优化等级,它在优化效果与可调试性之间提供了良好的平衡。
|
||||
|
||||
时间管理
|
||||
--------
|
||||
|
||||
已弃用的头文件 ``{IDF_TARGET_NAME}/rtc.h`` 已被移除,请改用替代头文件 ``esp_rtc_time.h``。
|
||||
|
||||
硬件支持
|
||||
--------
|
||||
|
||||
已弃用的头文件 ``soc_memory_types.h`` 已被移除,请改用替代头文件 ``esp_memory_utils.h``。
|
||||
|
||||
App Trace
|
||||
----------
|
||||
|
||||
已移除额外数据缓冲选项。不再支持 `CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX` 配置项。
|
||||
|
||||
FreeRTOS
|
||||
--------
|
||||
|
||||
**已移除的函数**
|
||||
|
||||
以下已弃用的 FreeRTOS 函数已在 ESP-IDF v6.0 中移除:
|
||||
|
||||
- :cpp:func:`xTaskGetAffinity` – 请使用 :cpp:func:`xTaskGetCoreID` 替代。
|
||||
- :cpp:func:`xTaskGetIdleTaskHandleForCPU` – 请使用 :cpp:func:`xTaskGetIdleTaskHandleForCore` 替代。
|
||||
- :cpp:func:`xTaskGetCurrentTaskHandleForCPU` – 请使用 :cpp:func:`xTaskGetCurrentTaskHandleForCore` 替代。
|
||||
|
||||
**已弃用的函数**
|
||||
|
||||
函数 :cpp:func:`pxTaskGetStackStart` 已弃用。请使用 :cpp:func:`xTaskGetStackStart` 替代以提高类型安全性。
|
||||
|
Reference in New Issue
Block a user