SafeWatchdog

The SafeWatchdog manages the watchdog by handling its initialization and servicing. It also adds safety checks before each watchdog trigger, these checks include validating the watchdog’s configuration and timeout value, as well as verifying that it is not serviced more frequently than allowed. If any of these checks fail, it initiates a software system reset via safeMonitor.

Public API

The public API of SafeWatchdog consists of a constructor and following methods:

    /**
     * Initializes the last watchdog service counter with maximum value, the counter will be
     * corrected in first cyclic() call.
     */
    SafeWatchdog();

    /**
     * Initializes the last watchdog service counter and calls the SafeWatchdog::enableMcuWatchdog
     * method.
     */
    void init();
    /**
     * Checks if the watchdog is running with the initial settings. If check fails, triggers
     * safeMonitor event which causes the software system reset. Checks if the watchdog is
     * not serviced more often than allowed, if fails triggers the reset through safeMonitor.
     * After these checks, it services the watchdog.
     */
    void cyclic();
    /**
     * Calls the enableMcuWatchdog method of bspMcuWatchdog by passing the watchdog timeout value.
     */
    static void enableMcuWatchdog();