FreeRTOS Exercise Lab05
Revision as of 11:50, 5 August 2019 by Jshankar (Created page with "__NOTOC__ == FreeRTOS Lab 05 == * Demonstrate the scheduler always selects the highest Ready state task to run *: by using the ''vTaskPrioritySet()'' API function to change th...")
FreeRTOS Lab 05
- Demonstrate the scheduler always selects the highest Ready state task to run
- by using the vTaskPrioritySet() API function to change the priority of two tasks relative to each other.
- Two tasks are created at two different priorities.
- Neither task makes any API function calls that cause it to enter the Blocked state,
- So both are in either Ready or Running state.
- So the task with highest priority will always be the task selected by the scheduler to be in Running state
- Expected Behavior
- Task 1 is created with the highest priority to be guaranteed to run first. Task 1 prints out a couple of strings before raising the priority of Task 2 to above its own priority.
- Task2 starts to run as it has the highest relative priority.
- Task 2 prints out a message before setting its own priority back to below that of Task 1.
- Task 1 is once again the highest priority task, so it starts to run and forcing Task 2 back into the Ready state.