task_wdt: use correct hardware watchdog channel number

The hardware watchdog was always fed with channel ID 0. This is correct
in most cases, but we should still use the actual ID returned from
wdt_install_timeout.

Signed-off-by: Martin Jäger <martin@libre.solar>
This commit is contained in:
Martin Jäger 2021-05-19 22:01:43 +02:00 committed by Kumar Gala
commit 79531c86a2

View file

@ -71,7 +71,7 @@ static void task_wdt_trigger(struct k_timer *timer_id)
#ifdef CONFIG_TASK_WDT_HW_FALLBACK
if (channel_id == TASK_WDT_BACKGROUND_CHANNEL) {
if (hw_wdt_dev) {
wdt_feed(hw_wdt_dev, 0);
wdt_feed(hw_wdt_dev, hw_wdt_channel);
}
return;
}
@ -202,7 +202,7 @@ int task_wdt_feed(int channel_id)
#ifdef CONFIG_TASK_WDT_HW_FALLBACK
if (hw_wdt_dev) {
wdt_feed(hw_wdt_dev, 0);
wdt_feed(hw_wdt_dev, hw_wdt_channel);
}
#endif