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.
Deleting a task in FreeRTOS
From the course: Introduction to FreeRTOS and Basic Task Management
Deleting a task in FreeRTOS
- [Instructor] Sometimes a task simply needs to do its job and then gets deleted so that we can reclaim the memory and other resources allocated to that task. In this lesson, we're going to see how to delete a task and we're going to use the same experimental approach we used in demonstrating how to suspend a task. So we're going to have a threshold and wait until the number of iterations crosses that threshold and then we'll delete the task. So let's start with to do item one here. At line nine, we would define the delete threshold. I'll say define and then I'll say delete thresh and I'll set it to 250 iterations. And also we would define the global variable, which we would call the delete monitor, to monitor when we've crossed the threshold. So at line 31, which is our to do item two over here, I'll have a uint32_t variable, which I'll call delete monitor. Once that is done, we go to the task function. We would use task one to delete task two, so we would go to task one. So we would…
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)
-
-