Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update taskSELECT_HIGHEST_PRIORITY_TASK macro for SMP #777

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/FreeRTOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,10 @@
#error configUSE_TASK_PREEMPTION_DISABLE is not supported in single core FreeRTOS
#endif

#if ( ( configNUMBER_OF_CORES > 1 ) && ( configUSE_PORT_OPTIMISED_TASK_SELECTION != 0 ) )
#error configUSE_PORT_OPTIMISED_TASK_SELECTION is not supported in SMP FreeRTOS
#endif

#ifndef configINITIAL_TICK_COUNT
#define configINITIAL_TICK_COUNT 0
#endif
Expand Down
10 changes: 5 additions & 5 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@
listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopPriority ] ) ); \
uxTopReadyPriority = uxTopPriority; \
} while( 0 ) /* taskSELECT_HIGHEST_PRIORITY_TASK */
#else /* if ( configNUMBER_OF_CORES == 1 ) */

#define taskSELECT_HIGHEST_PRIORITY_TASK( xCoreID ) prvSelectHighestPriorityTask( xCoreID )

#endif /* if ( configNUMBER_OF_CORES == 1 ) */

/*-----------------------------------------------------------*/
Expand All @@ -164,10 +168,6 @@

#else /* configUSE_PORT_OPTIMISED_TASK_SELECTION */

#if ( configNUMBER_OF_CORES > 1 )
#error configUSE_PORT_OPTIMISED_TASK_SELECTION not supported in FreeRTOS SMP.
#endif

/* If configUSE_PORT_OPTIMISED_TASK_SELECTION is 1 then task selection is
* performed in a way that is tailored to the particular microcontroller
* architecture being used. */
Expand Down Expand Up @@ -4701,7 +4701,7 @@ BaseType_t xTaskIncrementTick( void )
#endif

/* Select a new task to run. */
prvSelectHighestPriorityTask( xCoreID );
taskSELECT_HIGHEST_PRIORITY_TASK( xCoreID );
traceTASK_SWITCHED_IN();

/* After the new task is switched in, update the global errno. */
Expand Down