From 16fc8f5295cc666923dabfff9d268d8e16dd8259 Mon Sep 17 00:00:00 2001 From: Balaji Srinivasan Date: Tue, 4 Jun 2024 09:07:46 +0200 Subject: [PATCH] task_wdt: Feed hardware watchdog only when its started Previously the schedule_next_timeout() function was feeding the hardware watchdog irrespective of whether or not it was started. This is now fixed. Signed-off-by: Balaji Srinivasan --- subsys/task_wdt/task_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/task_wdt/task_wdt.c b/subsys/task_wdt/task_wdt.c index 1a4e21cf3eb..361acc0e156 100644 --- a/subsys/task_wdt/task_wdt.c +++ b/subsys/task_wdt/task_wdt.c @@ -79,7 +79,7 @@ static void schedule_next_timeout(int64_t current_ticks) k_timer_start(&timer, K_TIMEOUT_ABS_TICKS(next_timeout), K_FOREVER); #ifdef CONFIG_TASK_WDT_HW_FALLBACK - if (hw_wdt_dev) { + if (hw_wdt_started) { wdt_feed(hw_wdt_dev, hw_wdt_channel); } #endif