mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update prvYieldCore() compile warning for single core targets (#505)
When configNUM_CORES is 1, prvYieldCore() generates an array subscript outofbound error (-Warray-bounds) when compiled with GCC with space optimization enabled (-Os). This commit updates the code flow in prvYieldCore() to compile out the part where yield is needed on the other core which is unnecessary for single-core targets.
This commit is contained in:
parent
45dd83a8e3
commit
2eff037080
12
tasks.c
12
tasks.c
|
@ -703,11 +703,13 @@ static void prvYieldCore( BaseType_t xCoreID )
|
|||
{
|
||||
xYieldPendings[ xCoreID ] = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
portYIELD_CORE( xCoreID );
|
||||
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
|
||||
}
|
||||
#if ( configNUM_CORES > 1 )
|
||||
else
|
||||
{
|
||||
portYIELD_CORE( xCoreID );
|
||||
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue