From the course: Introduction to FreeRTOS and Basic Task Management
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Reading task priority
From the course: Introduction to FreeRTOS and Basic Task Management
Reading task priority
- [Trainer] So let's see how to read the priority of a task in runtime. Before we do that, let's analyze what a project is currently doing. As we see over here from lines 48 and 49, the project creates two tasks and both of them have priority level two as we see over here. When we go to their task functions, we realize that task one, simply increments its task profiler. Task two, on the other hand, does a bit of work by counting from 1 to 100,000 increments its task profiler and then checks if the profiler is greater than 100. And if the profiler is greater than 100, task two update the priority level of the same task, task two to one. So it update its own priority level to one. Our job here is to read the priority level of task two from task one to see whether it changes. To do this, we first declare a variable to hold the priority level that we read. So I'll come up here to line 33 and declare uint32_t. I'll call this task2_priority. Task two priority. And then we use this, I'll…
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)
-
-