/* Initialises the watchdog timer and sets up the interrupt.  */
void wdtInit(bool reset)
/* Initialises the watchdog timer and sets up the interrupt.  */
void wdtInit(bool reset)
{
  wdtClockSetup();
  SCB_SYSAHBCLKCTRL |= SCB_SYSAHBCLKCTRL_WDT;
  wdt_counter = 0;
  NVIC_EnableIRQ(WDT_IRQn);
  WDT_WDTC = WDT_FEED_VALUE;
  WDT_WDMOD = WDT_WDMOD_WDEN_ENABLED |
              reset ? WDT_WDMOD_WDRESET_ENABLED : WDT_WDMOD_WDRESET_DISABLED ;
}