watchdog: iwdg: honor IWDG_STM32_START_AT_BOOT
The Kconfig IWDG_STM32_START_AT_BOOT is actually not used and the watchdog is enabled unconditionnally at init. Enable the watchdog only if CONFIG_IWDG_STM32_START_AT_BOOT is set. Signed-off-by: Florian Vaussard <florian.vaussard@gmail.com>
This commit is contained in:
parent
ae71554be3
commit
d0fa58722d
1 changed files with 4 additions and 2 deletions
|
@ -145,13 +145,15 @@ static const struct wdt_driver_api iwdg_stm32_api = {
|
|||
|
||||
static int iwdg_stm32_init(struct device *dev)
|
||||
{
|
||||
IWDG_TypeDef *iwdg = IWDG_STM32_STRUCT(dev);
|
||||
struct wdt_config config;
|
||||
|
||||
config.timeout = CONFIG_IWDG_STM32_TIMEOUT;
|
||||
#ifdef CONFIG_IWDG_STM32_START_AT_BOOT
|
||||
IWDG_TypeDef *iwdg = IWDG_STM32_STRUCT(dev);
|
||||
|
||||
LL_IWDG_Enable(iwdg);
|
||||
#endif /* CONFIG_IWDG_STM32_START_AT_BOOT */
|
||||
|
||||
config.timeout = CONFIG_IWDG_STM32_TIMEOUT;
|
||||
iwdg_stm32_set_config(dev, &config);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue