Skip to content

patch: kick watchdog only if running #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions patches/0237-Watchdog-kick-only-if-watchdog-is-running.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 81a7d47a15e76701b206bce907526b9d9d5888cc Mon Sep 17 00:00:00 2001
From: pennam <m.pennasilico@arduino.cc>
Date: Wed, 2 Oct 2024 11:31:36 +0200
Subject: [PATCH] Watchdog: kick only if watchdog is running

---
drivers/source/Watchdog.cpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/source/Watchdog.cpp b/drivers/source/Watchdog.cpp
index 3f21b94dfb..daca018148 100644
--- a/drivers/source/Watchdog.cpp
+++ b/drivers/source/Watchdog.cpp
@@ -72,9 +72,11 @@ bool Watchdog::stop()

void Watchdog::kick()
{
- core_util_critical_section_enter();
- hal_watchdog_kick();
- core_util_critical_section_exit();
+ if (_running) {
+ core_util_critical_section_enter();
+ hal_watchdog_kick();
+ core_util_critical_section_exit();
+ }
}

bool Watchdog::is_running() const
--
2.45.2