Declare xCoreID outside if statement

This commit is contained in:
Felix van Oost 2024-12-22 10:02:45 -05:00
parent 54c5a9695b
commit 09329acb27

View file

@ -3855,6 +3855,7 @@ void vTaskSuspendAll( void )
#else /* #if ( configNUMBER_OF_CORES == 1 ) */ #else /* #if ( configNUMBER_OF_CORES == 1 ) */
{ {
UBaseType_t ulState; UBaseType_t ulState;
BaseType_t xCoreID;
/* This must only be called from within a task. */ /* This must only be called from within a task. */
portASSERT_IF_IN_ISR(); portASSERT_IF_IN_ISR();
@ -3868,7 +3869,7 @@ void vTaskSuspendAll( void )
* uxSchedulerSuspended since that will prevent context switches. */ * uxSchedulerSuspended since that will prevent context switches. */
ulState = portSET_INTERRUPT_MASK(); 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. */ /* This must never be called from inside a critical section. */
configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 ); configASSERT( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 0 );