Skip to content

Commit 81a7d47

Browse files
committed
Watchdog: kick only if watchdog is running
1 parent 1844a65 commit 81a7d47

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

drivers/source/Watchdog.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ bool Watchdog::stop()
7272

7373
void Watchdog::kick()
7474
{
75-
core_util_critical_section_enter();
76-
hal_watchdog_kick();
77-
core_util_critical_section_exit();
75+
if (_running) {
76+
core_util_critical_section_enter();
77+
hal_watchdog_kick();
78+
core_util_critical_section_exit();
79+
}
7880
}
7981

8082
bool Watchdog::is_running() const

0 commit comments

Comments
 (0)