diff options
author | Darian <32921628+Dazza0@users.noreply.github.com> | 2022-03-07 01:21:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-07 01:21:39 +0300 |
commit | 4446c8f0ea97707bdf12c403ab7d7fdbdd061418 (patch) | |
tree | 8d8c0175612541e692a3f10cf2c797880a119995 | |
parent | 4832377117b4198db43009f2b548497d9cdbf8da (diff) |
Fix pxPreviousTCB compile warning (#464)
When compiling with configNUM_CORES == 1 and configUSE_CORE_AFFINITY == 1,
pxPreviousTCB will generate a "set but unused" warning.
-rw-r--r-- | tasks.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -823,7 +823,7 @@ static void prvYieldForTask( TCB_t * pxTCB, BaseType_t xTaskScheduled = pdFALSE; BaseType_t xDecrementTopPriority = pdTRUE; - #if ( configUSE_CORE_AFFINITY == 1 ) + #if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) TCB_t * pxPreviousTCB = NULL; #endif #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 */ pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_NOT_RUNNING; - #if ( configUSE_CORE_AFFINITY == 1 ) + #if ( ( configNUM_CORES > 1 ) && ( configUSE_CORE_AFFINITY == 1 ) ) pxPreviousTCB = pxCurrentTCBs[ xCoreID ]; #endif pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID; |