File tree Expand file tree Collapse file tree
examples/template_configuration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 558558 * tskNO_AFFINITY if left undefined. */
559559#define configTIMER_SERVICE_TASK_CORE_AFFINITY tskNO_AFFINITY
560560
561+ /* When using SMP (i.e. configNUMBER_OF_CORES is greater than one), set
562+ * configIDLE_AFFINITY to 1 to pin each Idle task to its corresponding
563+ * core. When set to 1, Idle task N will only run on core N, using an affinity
564+ * mask of (1 << N). Set to 0 to allow the scheduler to run Idle tasks on any
565+ * available core. Defaults to 0 if left undefined. */
566+ #define configIDLE_AFFINITY 0
567+
561568/******************************************************************************/
562569/* ARMv8-M secure side port related definitions. ******************************/
563570/******************************************************************************/
Original file line number Diff line number Diff line change 377377 #define configIDLE_SHOULD_YIELD 1
378378#endif
379379
380+ #ifndef configIDLE_AFFINITY
381+ #define configIDLE_AFFINITY 0
382+ #endif
383+
380384#if configMAX_TASK_NAME_LEN < 1
381385 #error configMAX_TASK_NAME_LEN must be set to a minimum of 1 in FreeRTOSConfig.h
382386#endif
Original file line number Diff line number Diff line change @@ -3687,8 +3687,13 @@ static BaseType_t prvCreateIdleTasks( void )
36873687 /* Assign idle task to each core before SMP scheduler is running. */
36883688 xIdleTaskHandles [ xCoreID ]-> xTaskRunState = xCoreID ;
36893689 pxCurrentTCBs [ xCoreID ] = xIdleTaskHandles [ xCoreID ];
3690+ #if ( ( configIDLE_AFFINITY == 1 ) && ( configUSE_CORE_AFFINITY == 1 ) )
3691+ {
3692+ xIdleTaskHandles [ xCoreID ]-> uxCoreAffinityMask = ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID );
3693+ }
3694+ #endif
36903695 }
3691- #endif
3696+ #endif /* if ( configNUMBER_OF_CORES == 1 ) */
36923697 }
36933698 }
36943699
You can’t perform that action at this time.
0 commit comments