6#include <zephyr/drivers/watchdog.h>
7#include <zephyr/sys/reboot.h>
17static int wdt_channel_id = -1;
18static const device *
const WDT = DEVICE_DT_GET(DT_ALIAS(watchdog0));
28 if (device_is_ready(WDT)) {
29 static wdt_timeout_cfg wdt_config{};
30 wdt_config.flags = WDT_FLAG_RESET_SOC;
31#ifndef USE_BOOTLOADER_MCUBOOT
34 wdt_config.window.max = 30000;
35#elif defined(USE_ZIGBEE)
37 wdt_config.window.max = 10000;
39 wdt_config.window.max = 2000;
41 wdt_channel_id = wdt_install_timeout(WDT, &wdt_config);
42 if (wdt_channel_id >= 0) {
45 options |= WDT_OPT_PAUSE_HALTED_BY_DBG;
48 options |= WDT_OPT_PAUSE_IN_SLEEP;
60 if (wdt_channel_id >= 0) {
61 wdt_feed(WDT, wdt_channel_id);
pthread_t & main_loop_thread()