Watchdog timers – Wavetronix Click 500 (programmable controller) (CLK-500) - Developer Guide User Manual
Page 63
62
CHAPTER 6 • TIMERS AND CLOCKS
While this is a simple example, it is easy to see how cooperative multitasking can be ex-
tended to run multiple processes in virtual simultaneity using state machines that slice up
the processor’s valuable execution time.
Watchdog Timers
The watchdog timer prevents the Click 500 from becoming unresponsive. The watchdog
will reset the device if left unattended for fifteen seconds or more. The ClickUtilUserWatch-
DogHit function is used to indicate that the Click 500 is functioning properly. This function
is called each time an operating mode or task completes. However, if an mode or task does
not return within the watchdog period of fifteen seconds, then the developer will need to
call the ClickUtilUserWatchDogHit function within the mode or task.
Mode 2 in the preceding section will cause the device to reboot if the push-button is not
{
Startup = FALSE;
ClickLedOff(ALLRED);
}
}
else
{
PlayPauseBtnCheck();
}
UpdateProgress();
}
// Blocking wait
ClickLedOn(ALLRED);
ClickUtilPause(10000);
ClickUtilUserWatchDogHit();
ClickLedOff(ALLRED);
ClickUtilConditionalPause(10000,ClickBtnPressed);
Startup = FALSE;
ClickLedOff(ALLRED);
}
else
{
PlayPauseBtnCheck();
}
UpdateProgress();
}