Skip to content
Permalink
Browse files

samples/drivers/watchdog: make it work on STM32

IWDG driver for STM32 doesn't support the callback parameter.
The patch adds necessary workaround for STM32.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
  • Loading branch information...
frantony authored and nashif committed May 10, 2019
1 parent 197197a commit bfcfe14764f1979fb2dbfa0b7c57a388f56ad8a7
Showing with 5 additions and 0 deletions.
  1. +5 −0 samples/drivers/watchdog/src/main.c
@@ -54,6 +54,11 @@ void main(void)
wdt_config.callback = wdt_callback;

wdt_channel_id = wdt_install_timeout(wdt, &wdt_config);
if (wdt_channel_id == -ENOTSUP) {
/* IWDG driver for STM32 doesn't support callback */
wdt_config.callback = NULL;
wdt_channel_id = wdt_install_timeout(wdt, &wdt_config);
}
if (wdt_channel_id < 0) {
printk("Watchdog install error\n");
return;

0 comments on commit bfcfe14

Please sign in to comment.
You can’t perform that action at this time.