Complete the code to feed the watchdog by writing the correct function call.
void main() {
// Feed the watchdog
[1]();
}The function kick_watchdog() is used to feed or reset the watchdog timer to prevent system reset.
Complete the code to initialize the watchdog with a timeout value of 1000 milliseconds.
void setup() {
watchdog_init([1]);
}The watchdog is initialized with a timeout of 1000 milliseconds to reset the system if not fed within this time.
Fix the error in the watchdog feeding code by completing the missing function call.
int main() {
while(1) {
// Feed the watchdog
[1]();
delay_ms(500);
}
return 0;
}The correct function to feed the watchdog repeatedly is kick_watchdog(). This prevents the system from resetting.
Fill both blanks to create a dictionary that maps watchdog states to their descriptions.
const char* watchdog_states[] = {"[1]", "[2]"};The watchdog states are commonly represented as "ACTIVE" and "INACTIVE" to indicate if it is running or stopped.
Fill all three blanks to complete the watchdog feeding function with proper checks.
void feed_watchdog() {
if (watchdog_[1]()) {
[2]_watchdog();
} else {
watchdog_[3]();
}
}This function checks if the watchdog is running using is_running(). If yes, it feeds the watchdog with kick_watchdog(). Otherwise, it starts the watchdog with start_watchdog().