FreeRTOS - Design Patterns for RTOS
Consider this simplified watchdog task code snippet in FreeRTOS:
What happens if the monitored task never calls
void WatchdogTask(void *pvParameters) {
for (;;) {
if (xSemaphoreTake(watchdogSemaphore, pdMS_TO_TICKS(1000)) == pdFALSE) {
// No reset signal received
vTaskDelay(pdMS_TO_TICKS(500));
// Take recovery action
} else {
// Reset signal received
vTaskDelay(pdMS_TO_TICKS(100));
}
}
}What happens if the monitored task never calls
xSemaphoreGive(watchdogSemaphore)?