Watchdog cleanup (#15283)

This commit is contained in:
Scott Lahteine
2019-09-29 17:57:29 -05:00
committed by GitHub
parent 24706aedbd
commit 139b7196a0
28 changed files with 73 additions and 97 deletions

View File

@ -42,7 +42,7 @@
WDT->INTENCLR.reg = WDT_INTENCLR_EW; // Disable early warning interrupt
WDT->CONFIG.reg = WDT_CONFIG_PER_CYC4096; // Set at least 4s period for chip reset
watchdog_reset();
HAL_watchdog_refresh();
WDT->CTRLA.reg = WDT_CTRLA_ENABLE; // Start watchdog now in normal mode
SYNC(WDT->SYNCBUSY.bit.ENABLE);

View File

@ -25,7 +25,7 @@ void watchdog_init();
// Reset watchdog. MUST be called at least every 4 seconds after the
// first watchdog_init or SAMD will go into emergency procedures.
inline void watchdog_reset() {
inline void HAL_watchdog_refresh() {
SYNC(WDT->SYNCBUSY.bit.CLEAR); // Test first if previous is 'ongoing' to save time waiting for command execution
WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY;
}