summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/watchdog.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/src/watchdog.c')
-rw-r--r--zephyr/shim/src/watchdog.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/zephyr/shim/src/watchdog.c b/zephyr/shim/src/watchdog.c
index 2895868757..4c78ac9b0f 100644
--- a/zephyr/shim/src/watchdog.c
+++ b/zephyr/shim/src/watchdog.c
@@ -44,6 +44,13 @@ int watchdog_init(void)
wdt_config.callback = wdt_warning_handler;
err = wdt_install_timeout(wdt, &wdt_config);
+
+ /* If watchdog is running, reinstall it. */
+ if (err == -EBUSY) {
+ wdt_disable(wdt);
+ err = wdt_install_timeout(wdt, &wdt_config);
+ }
+
if (err < 0) {
LOG_ERR("Watchdog install error");
return err;