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 WDT_Disable(WDT); with *WDT_Init(); * in the init() function.
That is now first hand a neutral solution, but gives you the ability to define a strong version of *WDT_Init(); * 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?
