Merge branch 'bugfix/freertos_tick_hook_build_issue_v5.2' into 'release/v5.2'

fix(freertos/idf): Fix build error when CONFIG_FREERTOS_USE_TICK_HOOK is enabled (v5.2)

See merge request espressif/esp-idf!29434
This commit is contained in:
Marius Vikhammer 2024-03-06 20:16:22 +08:00
commit 9fe886edcd
3 changed files with 10 additions and 8 deletions

View File

@ -3319,7 +3319,7 @@ BaseType_t xTaskIncrementTick( void )
{
/* Guard against the tick hook being called when the pended tick
* count is being unwound (when the scheduler is being unlocked). */
if( xPendedTicksTemp == ( TickType_t ) 0 )
if( xPendedTicks == ( TickType_t ) 0 )
{
xCallTickHook = pdTRUE;
}

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -18,11 +18,11 @@ a definition for vApplicationTickHook(). Thus this test cannot be run.
#include "unity.h"
#include "test_utils.h"
#ifndef CONFIG_FREERTOS_SMP
#if !CONFIG_FREERTOS_SMP
/*
Test FreeRTOS idle hook. Only compiled in if FreeRTOS idle hooks are enabled.
*/
#if ( configUSE_IDLE_HOOK == 1 )
#if CONFIG_FREERTOS_USE_IDLE_HOOK
static volatile unsigned idle_count;
@ -38,12 +38,12 @@ TEST_CASE("FreeRTOS idle hook", "[freertos]")
TEST_ASSERT_NOT_EQUAL(0, idle_count); // The legacy idle hook should be called at least once
}
#endif // configUSE_IDLE_HOOK
#endif // CONFIG_FREERTOS_USE_IDLE_HOOK
/*
Test the FreeRTOS tick hook. Only compiled in if FreeRTOS tick hooks are enabled.
*/
#if ( configUSE_TICK_HOOK == 1 )
#if CONFIG_FREERTOS_USE_TICK_HOOK
static volatile unsigned tick_count;
@ -62,8 +62,8 @@ TEST_CASE("FreeRTOS tick hook", "[freertos]")
"The FreeRTOS tick hook should have been called approx 1 time per tick per CPU");
}
#endif // configUSE_TICK_HOOK
#endif // CONFIG_FREERTOS_SMP
#endif // CONFIG_FREERTOS_USE_TICK_HOOK
#endif // !CONFIG_FREERTOS_SMP
#if CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK

View File

@ -17,3 +17,5 @@ CONFIG_FREERTOS_RUN_TIME_COUNTER_TYPE_U64=y
CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH=y
CONFIG_FREERTOS_FPU_IN_ISR=y
CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=2
CONFIG_FREERTOS_USE_TICK_HOOK=y
CONFIG_FREERTOS_USE_IDLE_HOOK=y