mirror of https://github.com/ARMmbed/mbed-os.git
allow reconfiguring a running watchdog
parent
32f615e420
commit
fdf1c33a1f
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue