From 942fa51fb4e2cd8cd0b4c086af2a0436a810efcb Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Mon, 16 Dec 2024 22:56:59 -0500 Subject: [PATCH] Get core ID inline within vTaskSuspendAll() to resolve compiler warning --- tasks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks.c b/tasks.c index c86b076ee8..104d0376de 100644 --- a/tasks.c +++ b/tasks.c @@ -3869,7 +3869,6 @@ void vTaskSuspendAll( void ) #else /* #if ( configNUMBER_OF_CORES == 1 ) */ { UBaseType_t ulState; - BaseType_t xCoreID; /* This must only be called from within a task. */ portASSERT_IF_IN_ISR(); @@ -3882,10 +3881,9 @@ void vTaskSuspendAll( void ) * It is safe to re-enable interrupts after releasing the ISR lock and incrementing * uxSchedulerSuspended since that will prevent context switches. */ ulState = portSET_INTERRUPT_MASK(); - xCoreID = ( BaseType_t ) portGET_CORE_ID(); /* This must never be called from inside a critical section. */ - configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 ); + configASSERT( portGET_CRITICAL_NESTING_COUNT( portGET_CORE_ID() ) == 0 ); /* portSOFTWARE_BARRIER() is only implemented for emulated/simulated ports that * do not otherwise exhibit real time behaviour. */ @@ -7198,12 +7196,14 @@ static void prvResetNextTaskUnblockTime( void ) void vTaskExitCriticalFromISR( UBaseType_t uxSavedInterruptStatus ) { - const BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); + BaseType_t xCoreID; traceENTER_vTaskExitCriticalFromISR( uxSavedInterruptStatus ); if( xSchedulerRunning != pdFALSE ) { + xCoreID = ( BaseType_t ) portGET_CORE_ID(); + /* If critical nesting count is zero then this function * does not match a previous call to vTaskEnterCritical(). */ configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) > 0U );