Fix pxPreviousTCB compile warning (#464)

When compiling with configNUM_CORES == 1 and configUSE_CORE_AFFINITY == 1,
pxPreviousTCB will generate a "set but unused" warning.
pull/470/head
Darian 3 years ago committed by GitHub
parent 4832377117
commit 4446c8f0ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -823,7 +823,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
BaseType_t xTaskScheduled = pdFALSE; BaseType_t xTaskScheduled = pdFALSE;
BaseType_t xDecrementTopPriority = pdTRUE; BaseType_t xDecrementTopPriority = pdTRUE;
#if ( configUSE_CORE_AFFINITY == 1 ) #if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
TCB_t * pxPreviousTCB = NULL; TCB_t * pxPreviousTCB = NULL;
#endif #endif
#if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configNUM_CORES > 1 ) ) #if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configNUM_CORES > 1 ) )
@ -899,7 +899,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
{ {
/* If the task is not being executed by any core swap it in */ /* If the task is not being executed by any core swap it in */
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_NOT_RUNNING; pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_NOT_RUNNING;
#if ( configUSE_CORE_AFFINITY == 1 ) #if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
pxPreviousTCB = pxCurrentTCBs[ xCoreID ]; pxPreviousTCB = pxCurrentTCBs[ xCoreID ];
#endif #endif
pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID; pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID;

Loading…
Cancel
Save