Quickstart
Informative
The shortest path to a working watchdog: initialize, then keep refreshing the timeout at your control-flow watchpoints. Binding rules are in Wdg — Requirements; signatures in API Reference.
Bring the watchdog up
Wdg_Init(NULL_PTR); /* applies the configured default mode + initial timeout */
Refresh the timeout at watchpoints
Call Wdg_UpdateTimeout wherever you want to prove the control flow is alive — each call delays
the reset until the new timeout elapses:
for (;;) {
do_periodic_work();
Wdg_UpdateTimeout(50u); /* delay the reset by 50 ms; if we stop calling, the MCU resets */
}
Switch mode when needed
Wdg_SetMode(WDG_MODE_ALTERNATIVE); /* e.g. a longer timeout for a startup/standby phase */
/* ... */
Wdg_SetMode(WDG_MODE_NORMAL); /* back to normal running */
That is a complete direct-strategy watchdog. If your hardware needs the logical strategy, a
periodic timer calls Wdg_FeedHw — see Refresh the timeout. Modes are covered in Watchdog modes.