/* Task watchdog timer callback. 
If all task watchdogs have longer timeouts than the hardware watchdog, this function is called regularly (via the background channel). This should be avoided by setting CONFIG_TASK_WDT_MIN_TIMEOUT to the minimum task watchdog timeout used in the application. */
static void task_wdt_trigger(struct k_timer *timer_id)
/* Task watchdog timer callback. 
If all task watchdogs have longer timeouts than the hardware watchdog, this function is called regularly (via the background channel). This should be avoided by setting CONFIG_TASK_WDT_MIN_TIMEOUT to the minimum task watchdog timeout used in the application. */
static void task_wdt_trigger(struct k_timer *timer_id)
{
	uintptr_t channel_id = (uintptr_t)k_timer_user_data_get(timer_id);
	bool bg_channel = IS_ENABLED(CONFIG_TASK_WDT_HW_FALLBACK) &&
			  (channel_id == TASK_WDT_BACKGROUND_CHANNEL);
	if (bg_channel || channels[channel_id].reload_period == 0) {
		schedule_next_timeout(sys_clock_tick_get());
		return;
	}
	if (channels[channel_id].callback) {
		channels[channel_id].callback(channel_id,
			channels[channel_id].user_data);
	} else {
		sys_reboot(SYS_REBOOT_COLD);
	}
}