DUE Watchdog usage

gogol:
When trying to use the Watchdog on the DUE, you will come over short to one finding:
As variant.cpp contains the line WDT_Disable(WDT); in its init() function, the watchdog is disabled forever. So you need solutions, to prevent the disabling. I added now the following lines in variants.cpp before the init() function:

void WDT_Init();

#pragma weak WDT_Init
void WDT_Init()
{
  WDT_Disable(WDT);
}




And replaced <strong>*WDT_Disable(WDT);*</strong> with <strong>*WDT_Init(); *</strong> in the init() function.

That is now first hand a neutral solution, but gives you the ability to define a strong version of <strong>*WDT_Init(); *</strong> in your program. That can either be an empty-function, which leaves the Watchdog configured as from startup, or any other code, which changes the Watchdog to call the ISR WDT_Handler() or change any other settings.

Do I miss something in my thoughts or should this go into the main code?

A very nice solution to the problem!

Regards,
Ray L.