Skip to content

Commit 06df5d3

Browse files
authored
Merge pull request #967 from pennam/wdog-kik-fix
patch: kick watchdog only if running
2 parents 87a306c + f6792fa commit 06df5d3

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
From 81a7d47a15e76701b206bce907526b9d9d5888cc Mon Sep 17 00:00:00 2001
2+
From: pennam <[email protected]>
3+
Date: Wed, 2 Oct 2024 11:31:36 +0200
4+
Subject: [PATCH] Watchdog: kick only if watchdog is running
5+
6+
---
7+
drivers/source/Watchdog.cpp | 8 +++++---
8+
1 file changed, 5 insertions(+), 3 deletions(-)
9+
10+
diff --git a/drivers/source/Watchdog.cpp b/drivers/source/Watchdog.cpp
11+
index 3f21b94dfb..daca018148 100644
12+
--- a/drivers/source/Watchdog.cpp
13+
+++ b/drivers/source/Watchdog.cpp
14+
@@ -72,9 +72,11 @@ bool Watchdog::stop()
15+
16+
void Watchdog::kick()
17+
{
18+
- core_util_critical_section_enter();
19+
- hal_watchdog_kick();
20+
- core_util_critical_section_exit();
21+
+ if (_running) {
22+
+ core_util_critical_section_enter();
23+
+ hal_watchdog_kick();
24+
+ core_util_critical_section_exit();
25+
+ }
26+
}
27+
28+
bool Watchdog::is_running() const
29+
--
30+
2.45.2
31+

0 commit comments

Comments
 (0)