allow reconfiguring a running watchdog

pull/12511/head
Paul Szczepanek 2020-02-25 16:12:50 +00:00 committed by GitHub
parent 32f615e420
commit fdf1c33a1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 5 deletions

View File

@ -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()