Bird
0
0

Given this snippet inside a watchdog task:

medium📝 Predict Output Q4 of 15
FreeRTOS - Design Patterns for RTOS
Given this snippet inside a watchdog task:
if(xTaskNotifyWait(0, 0, &ulNotificationValue, pdMS_TO_TICKS(1000)) == pdTRUE) { resetWatchdogTimer(); }

What happens if no notification is received within 1000 ms?
AThe watchdog timer is not reset and may trigger a system reset
BThe watchdog timer is reset anyway
CThe task blocks indefinitely
DThe system immediately resets
Step-by-Step Solution
Solution:
  1. Step 1: Understand xTaskNotifyWait timeout behavior

    If no notification arrives within the timeout, xTaskNotifyWait returns pdFALSE.
  2. Step 2: Analyze conditional code effect

    resetWatchdogTimer() is called only if pdTRUE is returned, so no notification means no reset.
  3. Final Answer:

    The watchdog timer is not reset and may trigger a system reset -> Option A
  4. Quick Check:

    No notification = no reset = possible system reset [OK]
Quick Trick: No notification means watchdog timer not reset [OK]
Common Mistakes:
  • Assuming timer resets without notification
  • Thinking task blocks forever
  • Believing system resets immediately

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes