From fdf1c33a1ff1dec59194eefee6612fc5e26934bc Mon Sep 17 00:00:00 2001 From: Paul Szczepanek Date: Tue, 25 Feb 2020 16:12:50 +0000 Subject: [PATCH] allow reconfiguring a running watchdog --- drivers/source/Watchdog.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/source/Watchdog.cpp b/drivers/source/Watchdog.cpp index 670702f56e..3f21b94dfb 100644 --- a/drivers/source/Watchdog.cpp +++ b/drivers/source/Watchdog.cpp @@ -34,10 +34,6 @@ bool Watchdog::start(uint32_t timeout) MBED_ASSERT(timeout > 0); core_util_critical_section_enter(); - if (_running) { - core_util_critical_section_exit(); - return false; - } watchdog_config_t config; config.timeout_ms = timeout; watchdog_status_t sts = hal_watchdog_init(&config); @@ -45,7 +41,7 @@ bool Watchdog::start(uint32_t timeout) _running = true; } core_util_critical_section_exit(); - return _running; + return (sts == WATCHDOG_STATUS_OK); } bool Watchdog::start()