0
0
FreeRTOSprogramming~10 mins

vTaskDelete() for task removal in FreeRTOS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to delete the current FreeRTOS task.

FreeRTOS
void TaskFunction(void *pvParameters) {
    // Task code here
    [1](NULL); // Delete this task
}
Drag options to blanks, or click blank then click option'
AvTaskDelete
BxTaskCreate
CvTaskStartScheduler
DvTaskSuspend
Attempts:
3 left
💡 Hint
Common Mistakes
Using xTaskCreate instead of vTaskDelete.
Trying to suspend the task instead of deleting it.
2fill in blank
medium

Complete the code to delete a task using its handle.

FreeRTOS
TaskHandle_t xHandle = NULL;

// Task creation code here

[1](xHandle); // Delete the task using its handle
Drag options to blanks, or click blank then click option'
AvTaskSuspend
BvTaskDelete
CxTaskCreate
DvTaskResume
Attempts:
3 left
💡 Hint
Common Mistakes
Using xTaskCreate instead of vTaskDelete.
Trying to suspend or resume the task instead of deleting.
3fill in blank
hard

Fix the error in the code to properly delete the task.

FreeRTOS
void TaskFunction(void *pvParameters) {
    // Task code
    [1](NULL); // Incorrect deletion
}
Drag options to blanks, or click blank then click option'
AxTaskResume
BxTaskDelete
CvTaskSuspend
DvTaskDelete
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'xTaskDelete' which does not exist.
Confusing suspend and delete functions.
4fill in blank
hard

Fill both blanks to create and then delete a task properly.

FreeRTOS
TaskHandle_t xTaskHandle = NULL;

[1](TaskFunction, "Task", 1000, NULL, 1, &xTaskHandle);

[2](xTaskHandle);
Drag options to blanks, or click blank then click option'
AxTaskCreate
BvTaskSuspend
CvTaskDelete
DvTaskStartScheduler
Attempts:
3 left
💡 Hint
Common Mistakes
Using vTaskDelete before creating the task.
Using suspend instead of delete.
5fill in blank
hard

Fill all three blanks to create a task, delete it, and then start the scheduler.

FreeRTOS
TaskHandle_t xHandle = NULL;

[1](TaskFunction, "Task", 512, NULL, 2, &xHandle);

[2](xHandle);

[3]();
Drag options to blanks, or click blank then click option'
AxTaskCreate
BvTaskDelete
CvTaskStartScheduler
DvTaskSuspend
Attempts:
3 left
💡 Hint
Common Mistakes
Starting scheduler before creating tasks.
Deleting task before creating it.
Using suspend instead of delete.