From 09329acb27e1536427fa57133379086596c58968 Mon Sep 17 00:00:00 2001 From: Felix van Oost Date: Sun, 22 Dec 2024 10:02:45 -0500 Subject: [PATCH] Declare xCoreID outside if statement --- tasks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks.c b/tasks.c index a2af54d591..4090f445b7 100644 --- a/tasks.c +++ b/tasks.c @@ -3855,6 +3855,7 @@ 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(); @@ -3868,7 +3869,7 @@ void vTaskSuspendAll( void ) * uxSchedulerSuspended since that will prevent context switches. */ ulState = portSET_INTERRUPT_MASK(); - BaseType_t xCoreID = ( BaseType_t ) portGET_CORE_ID(); + xCoreID = ( BaseType_t ) portGET_CORE_ID(); /* This must never be called from inside a critical section. */ configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 );