Skip to content

Commit fdf1c33

Browse files
allow reconfiguring a running watchdog
1 parent 32f615e commit fdf1c33

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/source/Watchdog.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,14 @@ bool Watchdog::start(uint32_t timeout)
3434
MBED_ASSERT(timeout > 0);
3535

3636
core_util_critical_section_enter();
37-
if (_running) {
38-
core_util_critical_section_exit();
39-
return false;
40-
}
4137
watchdog_config_t config;
4238
config.timeout_ms = timeout;
4339
watchdog_status_t sts = hal_watchdog_init(&config);
4440
if (sts == WATCHDOG_STATUS_OK) {
4541
_running = true;
4642
}
4743
core_util_critical_section_exit();
48-
return _running;
44+
return (sts == WATCHDOG_STATUS_OK);
4945
}
5046

5147
bool Watchdog::start()

0 commit comments

Comments
 (0)