Actions

EmSys

FreeRTOS Exercise Lab05

From EdWiki

Revision as of 11:50, 5 August 2019 by Jshankar (Talk | contribs) (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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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
    1. 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.
    2. Task2 starts to run as it has the highest relative priority.
    3. Task 2 prints out a message before setting its own priority back to below that of Task 1.
    4. Task 1 is once again the highest priority task, so it starts to run and forcing Task 2 back into the Ready state.