B. Cannot suspend current task with NULL parameter
C. vTaskResume requires task handle, NULL is allowed
D. No errors, code is correct
Solution
Step 1: Check vTaskSuspend(NULL) usage
Passing NULL to vTaskSuspend suspends the current task, which is valid.
Step 2: Check vTaskResume(NULL) usage
Passing NULL to vTaskResume is invalid and causes an error because NULL is not a valid task handle to resume.
Final Answer:
vTaskResume(NULL) is invalid and causes error -> Option A
Quick Check:
vTaskResume(NULL) causes error [OK]
Hint: vTaskResume(NULL) is invalid, must use valid handle [OK]
Common Mistakes:
Assuming NULL resumes current task
Confusing suspend and resume parameters
Ignoring NULL parameter rules
5.
You want to create a task that waits for a button press event without using CPU time unnecessarily. Which task state should the task enter while waiting?
hard
A. Blocked
B. Ready
C. Running
D. Suspended
Solution
Step 1: Understand waiting without CPU use
To avoid wasting CPU, the task should not be Running or Ready while waiting.
Step 2: Choose appropriate waiting state
Blocked state is used when a task waits for an event like a button press, so it sleeps until event occurs.
Step 3: Differentiate from Suspended
Suspended means paused by user, not event-driven waiting.
Final Answer:
Blocked -> Option A
Quick Check:
Wait for event = Blocked state [OK]
Hint: Wait for event = Blocked to save CPU [OK]
Common Mistakes:
Using Suspended instead of Blocked
Keeping task Ready and wasting CPU
Confusing Running with waiting
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.