Bird
0
0

Examine this FreeRTOS code snippet:

medium📝 Debug Q6 of 15
FreeRTOS - RTOS Fundamentals

Examine this FreeRTOS code snippet:

void vTaskExample(void *pvParameters) {
    vTaskResume(NULL);
    // Task code
}

What is the issue with calling vTaskResume(NULL) inside a task?

AThere is no issue; the code is correct
BvTaskResume(NULL) suspends the calling task incorrectly
CvTaskResume(NULL) causes a compile-time error
DCalling vTaskResume(NULL) resumes the calling task, which is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Understand vTaskResume()

    This function resumes a suspended task. Passing NULL resumes the calling task.
  2. Step 2: Identify the problem

    Resuming the calling task is invalid because the task is not suspended; it is already running.
  3. Final Answer:

    Calling vTaskResume(NULL) resumes the calling task, which is invalid -> Option D
  4. Quick Check:

    vTaskResume(NULL) resumes self, invalid if not suspended [OK]
Quick Trick: vTaskResume(NULL) resumes self; invalid if not suspended [OK]
Common Mistakes:
  • Assuming vTaskResume(NULL) suspends the task
  • Thinking it causes compile error
  • Believing the code is correct

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes