From cf124780492386f63349c857e421e7195056d232 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Wed, 17 Sep 2025 17:07:32 +0200 Subject: [PATCH] refactor(freertos): Deprecate xPortGetTickRateHz() This commit deprecates xPortGetTickRateHz() from the FreeRTOS port API as the FreeRTOS tickrate is constant for an application and can be inferred using the CONFIG_FREERTOS_HZ config option. --- .../portable/riscv/include/freertos/portmacro.h | 6 +++--- .../portable/xtensa/include/freertos/portmacro.h | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h index 83017af485..2280f54d46 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos/portmacro.h @@ -407,11 +407,11 @@ void vApplicationSleep(TickType_t xExpectedIdleTime); /** * @brief Get the tick rate per second * - * @note [refactor-todo] make this inline - * @note [refactor-todo] Check if this function should be renamed (due to uint return type) + * @deprecated This function will be removed in IDF 7.0. Use CONFIG_FREERTOS_HZ directly instead. + * @note [refactor-todo] Remove this function in IDF 7.0 (IDF-14115) * @return uint32_t Tick rate in Hz */ -uint32_t xPortGetTickRateHz(void); +uint32_t xPortGetTickRateHz(void) __attribute__((deprecated("This function will be removed in IDF 7.0. Use CONFIG_FREERTOS_HZ directly instead."))); /** * @brief Set a watchpoint to watch the last 32 bytes of the stack diff --git a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h index 2da5d7b714..ce0b206419 100644 --- a/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h +++ b/components/freertos/FreeRTOS-Kernel/portable/xtensa/include/freertos/portmacro.h @@ -345,10 +345,11 @@ void vApplicationSleep(TickType_t xExpectedIdleTime); /** * @brief Get the tick rate per second * - * @note [refactor-todo] make this inline + * @deprecated This function will be removed in IDF 7.0. Use CONFIG_FREERTOS_HZ directly instead. + * @note [refactor-todo] Remove this function in IDF 7.0 (IDF-14115) * @return uint32_t Tick rate in Hz */ -uint32_t xPortGetTickRateHz(void); +uint32_t xPortGetTickRateHz(void) __attribute__((deprecated("This function will be removed in IDF 7.0. Use CONFIG_FREERTOS_HZ directly instead."))); /** * @brief Set a watchpoint to watch the last 32 bytes of the stack