Now in your setup() call the `watchdog_setup();` once. At this time your watchdog is now active and running and will reset the SAMD21 if it times out within the interval you used.You will need to continually call the function `watchdog_clear();` to prevent the watchdog resetting the MCU.

Make sure you change the timeout in the setup function to suit your needs.It also does NOT wait for the SYNC bit when you request a clear. This can take some time (maybe 5mS) so it won't clear the watchdog in that case.