clear() function locks up the MCU for about 10ms as its waiting for synchronisation. For a fast running main loop i propose replacing the while(WDT->STATUS.bit.SYNCBUSY); loop with
void WDTZero::clearinloop() {
if((WDT->STATUS.bit.SYNCBUSY)==0){
WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; // Clear WTD bit
WDTZeroCounter = _ewtcounter; // Reset the early warning downcounter value
}
}
Or some other solution that would work in loop as also outside the loop and would not lock up the MCU
clear() function locks up the MCU for about 10ms as its waiting for synchronisation. For a fast running main loop i propose replacing the while(WDT->STATUS.bit.SYNCBUSY); loop with
void WDTZero::clearinloop() { if((WDT->STATUS.bit.SYNCBUSY)==0){ WDT->CLEAR.reg = WDT_CLEAR_CLEAR_KEY; // Clear WTD bit WDTZeroCounter = _ewtcounter; // Reset the early warning downcounter value }
}
Or some other solution that would work in loop as also outside the loop and would not lock up the MCU