Skip to content

Commit a132ebf

Browse files
dleach02danieldegrasse
authored andcommitted
drivers: watchdog: Add enableWait setting for wdt_mcux_imx_wdog
When WDT_OPT_PAUSE_IN_SLEEP option is passed in set enableWait flag in addition to the enableStop. Fixes #86437 Signed-off-by: David Leach <david.leach@nxp.com>
1 parent 3eee7c5 commit a132ebf

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

drivers/watchdog/wdt_mcux_imx_wdog.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,27 @@ static int mcux_wdog_setup(const struct device *dev, uint8_t options)
4141
return -EINVAL;
4242
}
4343

44+
/*
45+
* WDT_OPT_PAUSE_IN_SLEEP is a bit tricky because depending on
46+
* the frequency the platform is running at and the wdog timeout
47+
* value relative to the sleep time, the system may wakeup enough
48+
* to keep system time accurate enough on timer rollovers. During
49+
* this time, the wdog will start ticking again so you can
50+
* possibly still have the wdog expire.
51+
*
52+
*/
53+
data->wdog_config.workMode.enableWait =
54+
(options & WDT_OPT_PAUSE_IN_SLEEP) == 0U;
55+
4456
data->wdog_config.workMode.enableStop =
4557
(options & WDT_OPT_PAUSE_IN_SLEEP) == 0U;
4658

4759
data->wdog_config.workMode.enableDebug =
4860
(options & WDT_OPT_PAUSE_HALTED_BY_DBG) == 0U;
4961

62+
LOG_DBG("Setup the watchdog: options: %d", options);
63+
5064
WDOG_Init(base, &data->wdog_config);
51-
LOG_DBG("Setup the watchdog");
5265

5366
return 0;
5467
}

0 commit comments

Comments
 (0)