Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRTOS/FreeRTOS-Kernel.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarian <32921628+Dazza0@users.noreply.github.com>2022-03-07 01:21:39 +0300
committerGitHub <noreply@github.com>2022-03-07 01:21:39 +0300
commit4446c8f0ea97707bdf12c403ab7d7fdbdd061418 (patch)
tree8d8c0175612541e692a3f10cf2c797880a119995
parent4832377117b4198db43009f2b548497d9cdbf8da (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tasks.c b/tasks.c
index 901c73899..82133ebdf 100644
--- a/tasks.c
+++ b/tasks.c
@@ -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;