drivers: watchdog: Fix callback call on STM32 WWDG enable

When using the EWIF it is a good idea to clear it before enabling the
watchdog. Otherwise, the watchdog callback will be called upon watchdog
enable if EWIF is enabled. This patch fixes this case.

Signed-off-by: Ioannis Konstantelias <ikonstadel@gmail.com>
This commit is contained in:
Ioannis Konstantelias 2019-12-05 10:49:31 +02:00 committed by Ioannis Glaropoulos
commit 226d71a9c2

View file

@ -151,6 +151,9 @@ static int wwdg_stm32_setup(struct device *dev, u8_t options)
return -ENOTSUP; return -ENOTSUP;
} }
/* Ensure that Early Wakeup Interrupt Flag is cleared */
LL_WWDG_ClearFlag_EWKUP(wwdg);
/* Enable the WWDG */ /* Enable the WWDG */
LL_WWDG_Enable(wwdg); LL_WWDG_Enable(wwdg);