From 04d80db499eb91d01115a03303d8116ed536c707 Mon Sep 17 00:00:00 2001 From: Zim Kalinowski Date: Tue, 19 Oct 2021 12:07:56 +0800 Subject: [PATCH] freertos: Move Espressif's specific esp_reent_init into collective ifdef --- components/freertos/FreeRTOS-Kernel/tasks.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/components/freertos/FreeRTOS-Kernel/tasks.c b/components/freertos/FreeRTOS-Kernel/tasks.c index 9d144cb3a7..f7f49f797e 100644 --- a/components/freertos/FreeRTOS-Kernel/tasks.c +++ b/components/freertos/FreeRTOS-Kernel/tasks.c @@ -45,10 +45,12 @@ #undef taskEXIT_CRITICAL #undef taskENTER_CRITICAL_ISR #undef taskEXIT_CRITICAL_ISR -#define taskENTER_CRITICAL( ) portENTER_CRITICAL( taskCRITICAL_MUX ) +#define taskENTER_CRITICAL( ) portENTER_CRITICAL( taskCRITICAL_MUX ) #define taskEXIT_CRITICAL( ) portEXIT_CRITICAL( taskCRITICAL_MUX ) -#define taskENTER_CRITICAL_ISR( ) portENTER_CRITICAL_ISR( taskCRITICAL_MUX ) +#define taskENTER_CRITICAL_ISR( ) portENTER_CRITICAL_ISR( taskCRITICAL_MUX ) #define taskEXIT_CRITICAL_ISR( ) portEXIT_CRITICAL_ISR( taskCRITICAL_MUX ) +#undef _REENT_INIT_PTR +#define _REENT_INIT_PTR esp_reent_init #endif /* Lint e9021, e961 and e750 are suppressed as a MISRA exception justified @@ -1102,11 +1104,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, #if ( configUSE_NEWLIB_REENTRANT == 1 ) { - // /* Initialise this task's Newlib reent structure. */ - // _REENT_INIT_PTR( ( &( pxNewTCB->xNewLib_reent ) ) ); - /* Initialise this task's Newlib reent structure. */ - esp_reent_init(&pxNewTCB->xNewLib_reent); + _REENT_INIT_PTR( ( &( pxNewTCB->xNewLib_reent ) ) ); } #endif