voidAdd to user application initialization (typically the start of main()):configure_wdt(void){/* Create a new configuration structure for the Watchdog settings and fill * with the default module settings. */structwdt_conf config_wdt;wdt_get_config_defaults(&config_wdt);/* Set the Watchdog configuration settings */config_wdt.always_on =false;#if !((SAML21) || (SAMC21) || (SAML22))config_wdt.clock_source = GCLK_GENERATOR_4;#endifconfig_wdt.timeout_period = WDT_PERIOD_2048CLK;/* Initialize and enable the Watchdog with the user settings */wdt_set_config(&config_wdt);}
configure_wdt();