Skip to content

Commit

Permalink
drivers/periph_wdt: fix auto starting of watchdog timer
Browse files Browse the repository at this point in the history
When WDT_HAS_INIT is non-zero (which it is for all but two supported
CPUs). The watchdog timer was not automatically started on boot when the
periph_wdt_auto_start module was enabled. This patch fixes this.
  • Loading branch information
Enoch247 committed Jun 19, 2024
1 parent aee2ea6 commit ad24c08
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/periph_common/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ void periph_init(void)
usbdev_init_lowlevel();
#endif

#if defined(MODULE_PERIPH_INIT_WDT) && WDT_HAS_INIT
wdt_init();
#if defined(MODULE_PERIPH_INIT_WDT)
if (WDT_HAS_INIT) {
wdt_init();
}

if (IS_ACTIVE(MODULE_PERIPH_WDT_AUTO_START)) {
wdt_setup_reboot(CONFIG_PERIPH_WDT_WIN_MIN_MS, CONFIG_PERIPH_WDT_WIN_MAX_MS);
Expand Down

0 comments on commit ad24c08

Please # to comment.