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.

The task suspension and resumption functions

The task suspension and resumption functions

- [Instructor] Let's examine the functions for suspending and resuming tasks, starting with a suspension function. Here is the prototype of the vTaskSuspend. This function suspends a task. Once a task is suspended, it won't be scheduled for execution by the free auto scheduler until it is explicitly resumed. The vTaskSuspend takes a single parameter. This is the X task to suspend. This is the handle of the task we want to suspend. If we pass NULL, the currently running task will be suspended, and this can be useful when we want a task to pause itself. Suspending a task is especially useful in scenarios where we need to conserve CPU time to prioritize other tasks, while the suspended task remains inactive. Let's move on to the task resumption. Over here, we use the vTaskResume. This function also has a single parameter, and this is the handle of the task we want to resume.

Contents