atsamd: Don't clear the watchdog if a clear is still in progress

Clearing the watchdog while it is in progress can cause bus stalls on
the SAMD21.  It appears that clearing the watchdog on the SAMD51 can
cause lockups of the watchdog device.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-02-15 22:13:28 -05:00
parent 00e0a70a94
commit a00657d2ae
2 changed files with 4 additions and 2 deletions

View File

@ -10,7 +10,8 @@
void
watchdog_reset(void)
{
WDT->CLEAR.reg = 0xa5;
if (!(WDT->SYNCBUSY.reg & WDT_SYNCBUSY_CLEAR))
WDT->CLEAR.reg = 0xa5;
}
DECL_TASK(watchdog_reset);

View File

@ -10,7 +10,8 @@
void
watchdog_reset(void)
{
WDT->CLEAR.reg = 0xa5;
if (!(WDT->STATUS.reg & WDT_STATUS_SYNCBUSY))
WDT->CLEAR.reg = 0xa5;
}
DECL_TASK(watchdog_reset);