diff --git a/components/freertos/esp_additions/freertos_tasks_c_additions.h b/components/freertos/esp_additions/freertos_tasks_c_additions.h index 5ed38208ee..c267120cec 100644 --- a/components/freertos/esp_additions/freertos_tasks_c_additions.h +++ b/components/freertos/esp_additions/freertos_tasks_c_additions.h @@ -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 ); } /*----------------------------------------------------------*/ diff --git a/components/freertos/esp_additions/include/freertos/idf_additions.h b/components/freertos/esp_additions/include/freertos/idf_additions.h index 33e01469f8..00c903c165 100644 --- a/components/freertos/esp_additions/include/freertos/idf_additions.h +++ b/components/freertos/esp_additions/include/freertos/idf_additions.h @@ -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,6 +626,16 @@ void vStreamBufferGenericDeleteWithCaps( StreamBufferHandle_t xStreamBuffer, #endif /* configSUPPORT_STATIC_ALLOCATION == 1 */ +/* --------------------------------------------------- Deprecated ------------------------------------------------------ + * Deprecated IDF FreeRTOS API additions. + * Todo: Remove in v7.0 (IDF-13569) + * ------------------------------------------------------------------------------------------------------------------ */ +/** @cond */ + +uint8_t * pxTaskGetStackStart( TaskHandle_t xTask ) __attribute__((deprecated("Use xTaskGetStackStart() for improved type safety"))); + +/** @endcond */ + /* *INDENT-OFF* */ #ifdef __cplusplus } 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 353b1a5b2e..0490b19ea4 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 @@ -60,8 +60,14 @@ Removed extra data buffering option. `CONFIG_APPTRACE_PENDING_DATA_SIZE_MAX` is 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. 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 8168dc92d7..e9f5300c11 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 @@ -40,8 +40,14 @@ Xtensa 特殊寄存器头文件已更新,使用新的命名约定。旧的 ``s 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` 替代以提高类型安全性。