Zephyr -- Watchdog Driver
Consumer // config watchdog static inline int wdt_install_timeout(const struct device *dev, const struct wdt_timeout_cfg *cfg); // enable watchdog __syscall int wdt_setup(const struct device *dev, uint8_t options); // disable watchdog __syscall int wdt_disable(const struct device *dev); // feed wathdog __syscall int wdt_feed(const struct device *dev, int channel_id); wdt_install_timeout()需要在wdt_setup()之前。 示例code: //samples/drivers/watchdog/src/main.c struct wdt_timeout_cfg wdt_config = { /* Reset SoC when watchdog timer expires. */ .flags = WDT_FLAG_RESET_SOC, /* Expire watchdog after max window */ ....