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

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…

Contents