Tasking Library: stopping and starting tasks
I'm stopping and starting tasks in a project of mine during runtime. It works for me, but there is no documentation to this usecase available, so I wanted to check if what I do is allowed and specified behaviour.
Example:
Initialization:
ctl_task_run(&xLED_task, LED_PRIORITY, LEDTask, 0, "LED_task", LED_STACKSIZE, g_anLED_task_stack + 1, 0);
After some time, I stop the task and restart it:
ctl_task_remove(&xLED_task);
// set some new parameters for the task
// restart it:
ctl_task_run(&xLED_task, LED_PRIORITY, LEDTask, 0, "LED_task", LED_STACKSIZE, g_anLED_task_stack + 1, 0);
The task itsself doesn't set any mutexes, so removing it whenever and not running it again is no functional problem.
Another Question:
Calling ctl_task_remove and ctl_task_run from the task to remove/run itsself, does that break something?
Please sign in to leave a comment.
Comments
6 comments