From the course: Introduction to FreeRTOS and Basic Task Management
Unlock this course with a free trial
Join today to access over 25,600 courses taught by industry experts.
Resuming a suspended task
From the course: Introduction to FreeRTOS and Basic Task Management
Resuming a suspended task
- [Instructor] Let's see how to resume a suspended task. Before we do that, let's analyze what we have. We have two tasks in this project. And when we scroll down to the task functions, task function one at line 69, we see that Task1 suspends task2 after a number of iterations, 250 to be exact. Over here, we want to resume task2 after a number of iterations to reverse the process. So we're going to follow the same method we used to suspend task2. We start off by declaring a threshold that should be crossed to resume task2 for experimental purposes. So over here at line 11, I'll define the resume threshold. I'll say #define over here, and then I'll call this RESUME_THRESH, and I'll say 250. So meaning, after 250 iterations, the task gets suspended. After another 250 iterations, the task gets resumed. And this will allow us to properly monitor the sequence. Also, just like we have suspend_monitor, we would have resume_monitor. So at line 34, we can create resume_monitor over here by…
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)
-
-