File syn_port_wdt.h¶
FileList > port > syn_port_wdt.h
Go to the source code of this file
Platform port: Hardware Watchdog Timer (WDT). More...
#include "../common/syn_defs.h"#include <stdint.h>
Public Functions¶
| Type | Name |
|---|---|
| void | syn_port_wdt_feed (void) Feed (pet) the hardware watchdog, resetting its counter. |
| SYN_Status | syn_port_wdt_init (uint32_t timeout_ms) Configure and start the hardware watchdog. |
Detailed Description¶
The hardware watchdog resets the MCU if not fed within the timeout window — even if the CPU is hard-locked (unlike the software watchdog in syn_watchdog.h which requires the scheduler to keep running).
Public Functions Documentation¶
function syn_port_wdt_feed¶
Feed (pet) the hardware watchdog, resetting its counter.
Must be called more frequently than the timeout configured in syn_port_wdt_init() to prevent a hardware reset.
function syn_port_wdt_init¶
Configure and start the hardware watchdog.
Once started, the watchdog cannot be stopped without a reset on most MCUs. Call syn_port_wdt_feed() regularly within the timeout window.
Parameters:
timeout_msDesired watchdog timeout in milliseconds. The port will round to the nearest supported value.
Returns:
SYN_OK on success, SYN_ERROR if the WDT cannot be started.
The documentation for this class was generated from the following file src/syntropic/port/syn_port_wdt.h