Skip to content

Commit 87279a3

Browse files
committed
Fixed static allocation internal array
1 parent 6369b03 commit 87279a3

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

tasks.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,9 +761,11 @@ static void prvYieldForTask( TCB_t * pxTCB,
761761
{
762762
if( xTaskPriority <= xLowestPriority )
763763
{
764+
#if( configNUM_CORES > 1 )
764765
#if ( configUSE_CORE_AFFINITY == 1 )
765766
if( ( pxTCB->uxCoreAffinityMask & ( 1 << x ) ) != 0 )
766767
#endif
768+
#endif
767769
{
768770
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
769771
if( pxCurrentTCBs[ x ]->xPreemptionDisable == pdFALSE )
@@ -893,9 +895,11 @@ static void prvYieldForTask( TCB_t * pxTCB,
893895

894896
if( pxTCB->xTaskRunState == taskTASK_NOT_RUNNING )
895897
{
898+
#if ( configNUM_CORES > 1 )
896899
#if ( configUSE_CORE_AFFINITY == 1 )
897900
if( ( pxTCB->uxCoreAffinityMask & ( 1 << xCoreID ) ) != 0 )
898901
#endif
902+
#endif
899903
{
900904
/* If the task is not being executed by any core swap it in */
901905
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_NOT_RUNNING;
@@ -910,9 +914,11 @@ static void prvYieldForTask( TCB_t * pxTCB,
910914
else if( pxTCB == pxCurrentTCBs[ xCoreID ] )
911915
{
912916
configASSERT( ( pxTCB->xTaskRunState == xCoreID ) || ( pxTCB->xTaskRunState == taskTASK_YIELDING ) );
917+
#if( configNUM_CORES > 1 )
913918
#if ( configUSE_CORE_AFFINITY == 1 )
914919
if( ( pxTCB->uxCoreAffinityMask & ( 1 << xCoreID ) ) != 0 )
915920
#endif
921+
#endif
916922
{
917923
/* The task is already running on this core, mark it as scheduled */
918924
pxTCB->xTaskRunState = ( TaskRunning_t ) xCoreID;
@@ -975,6 +981,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
975981
}
976982
#endif /* if ( ( configRUN_MULTIPLE_PRIORITIES == 0 ) && ( configNUM_CORES > 1 ) ) */
977983

984+
#if ( configNUM_CORES > 1 )
978985
#if ( configUSE_CORE_AFFINITY == 1 )
979986
if( ( pxPreviousTCB != NULL ) && ( listIS_CONTAINED_WITHIN( &( pxReadyTasksLists[ pxPreviousTCB->uxPriority ] ), &( pxPreviousTCB->xStateListItem ) ) != pdFALSE ) )
980987
{
@@ -1029,6 +1036,7 @@ static void prvYieldForTask( TCB_t * pxTCB,
10291036
}
10301037
}
10311038
#endif /* if ( configUSE_CORE_AFFINITY == 1 ) */
1039+
#endif /* if ( configNUM_CORES > 1 ) */
10321040

10331041
return pdTRUE;
10341042
}
@@ -1077,7 +1085,6 @@ static void prvYieldForTask( TCB_t * pxTCB,
10771085

10781086
if( ( pxTaskBuffer != NULL ) && ( puxStackBuffer != NULL ) )
10791087
{
1080-
prvTaskCreator( pxTaskCode, ulStack)
10811088
/* The memory used for the task's TCB and stack are passed into this
10821089
* function - use them. */
10831090
pxNewTCB = ( TCB_t * ) pxTaskBuffer; /*lint !e740 !e9087 Unusual cast is ok as the structures are designed to have the same alignment, and the size is checked by an assert. */
@@ -1481,11 +1488,13 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
14811488
}
14821489
#endif
14831490

1491+
#if ( configNUM_CORES > 1 )
14841492
#if ( configUSE_CORE_AFFINITY == 1 )
14851493
{
14861494
pxNewTCB->uxCoreAffinityMask = tskNO_AFFINITY;
14871495
}
14881496
#endif
1497+
#endif
14891498
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
14901499
{
14911500
pxNewTCB->xPreemptionDisable = 0;
@@ -2222,6 +2231,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
22222231
#endif /* INCLUDE_vTaskPrioritySet */
22232232
/*-----------------------------------------------------------*/
22242233

2234+
#if ( configNUM_CORES > 1 )
22252235
#if ( configUSE_CORE_AFFINITY == 1 )
22262236

22272237
void vTaskCoreAffinitySet( const TaskHandle_t xTask,
@@ -2253,8 +2263,10 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
22532263
}
22542264

22552265
#endif /* configUSE_CORE_AFFINITY */
2266+
#endif
22562267
/*-----------------------------------------------------------*/
22572268

2269+
#if ( configNUM_CORES > 1 )
22582270
#if ( configUSE_CORE_AFFINITY == 1 )
22592271

22602272
UBaseType_t vTaskCoreAffinityGet( const TaskHandle_t xTask )
@@ -2273,6 +2285,8 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB )
22732285
}
22742286

22752287
#endif /* configUSE_CORE_AFFINITY */
2288+
#endif
2289+
22762290
/*-----------------------------------------------------------*/
22772291

22782292
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
@@ -2695,7 +2709,7 @@ static BaseType_t prvCreateIdleTasks( void )
26952709
else
26962710
{
26972711
static StaticTask_t xIdleTCBBuffers[configNUM_CORES-1];
2698-
static StackType_t xIdleTaskStackBuffers[configMINIMAL_STACK_SIZE][configNUM_CORES-1];
2712+
static StackType_t xIdleTaskStackBuffers[configNUM_CORES-1][configMINIMAL_STACK_SIZE];
26992713

27002714
xIdleTaskHandle[ xCoreID ] = xTaskCreateStatic( prvMinimalIdleTask,
27012715
cIdleName,

0 commit comments

Comments
 (0)