freeRTOS Deleting a Task
vTaskDelete() A task can use the vTaskDelete() API function to delete itself, or any other task. Note that the vTaskDelete() API function is available only when INCLUDE_vTaskDelete is set to 1 in FreeRTOSConfig.h. Deleted tasks no longer exist and cannot enter the Running state again. It is the responsibility of the idle task to free memory allocated to tasks that have since been deleted. Therefore, it is important that applications using the vTaskDelete() API function do not completely starve the idle task of all processing time . Note: Only memory allocated to a task by the kernel itself will be freed automatically when the task is deleted. Any memory or other resource that the implementation of the task allocated must be freed explicitly. void vTaskDelete( TaskHandle_t pxTaskToDelete ); pxTaskToDelete The handle of the task that is to be deleted (the subject task)—see the pxCreatedTask parameter of the xTaskCreate() API function for information on obtaining handles t...
留言
張貼留言