Skip to content

Clear() freezes MCU for ~10ms #10

@AndrejValand

Description

@AndrejValand

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions