From the course: Introduction to FreeRTOS and Basic Task Management
Unlock the full course today
Join today to access over 25,200 courses taught by industry experts.
Changing task priority at runtime
From the course: Introduction to FreeRTOS and Basic Task Management
Changing task priority at runtime
- [Instructor] Let's see how to change the priority of a task in Runtime. To do that, let's first analyze what a project does. Lines 47 and 48 over here tells us that a project creates two tasks and they both have the same priority, priority level one. When we scroll down here to line 61 and line 74, we realize that both tasks simply increment their respective task profilers. Our job in this lesson is to let Task1 change the priority of Task2. To do this, we need task handles, so let's go up to line 31 and declare the task handles. I'll say TaskHandle_t and we're going to create two of them. I'll say task1_handle, and then task2_handle. Next, we have to update our xTaskCreate functions so that the returned task handles will be stored in these variables that we've created, so I'll copy task1_handle here and I'll come to the xTaskCreate function for Task1 at line 48 and I will update the last argument as &task1_handle. We have to pass the task handle address as the last argument and we…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
The task creation and deletion functions1m 26s
-
(Locked)
Creating Task Profilers and Task Functions4m 38s
-
(Locked)
Creating tasks in FreeRTOS5m 16s
-
(Locked)
Controlling hardware from different tasks3m 56s
-
(Locked)
Passing parameters to tasks5m 56s
-
(Locked)
The task priority functions54s
-
(Locked)
Understanding preemption1m 54s
-
(Locked)
Experimenting with different task priorities4m 24s
-
(Locked)
Changing task priority at runtime3m 59s
-
(Locked)
Reading task priority3m 29s
-
(Locked)
The task suspension and resumption functions1m 1s
-
(Locked)
Suspending a task4m 18s
-
(Locked)
Resuming a suspended task6m 29s
-
(Locked)
Deleting a task in FreeRTOS4m 50s
-
(Locked)
-
-