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 <balaji.srinivasan@nordicsemi.no>
This commit is contained in:
Balaji Srinivasan 2024-06-04 09:07:46 +02:00 committed by Carles Cufí
commit 16fc8f5295

View file

@ -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