Skip to content

Commit 383bf9a

Browse files
committed
Wait for the DFLL to be stable.
1 parent 07a8899 commit 383bf9a

File tree

1 file changed

+3
-0
lines changed
  • ports/atmel-samd/peripherals/samd21

1 file changed

+3
-0
lines changed

ports/atmel-samd/peripherals/samd21/clocks.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ static void init_clock_source_dfll48m_xosc(void) {
130130
SYSCTRL_DFLLCTRL_ENABLE;
131131
while (!SYSCTRL->PCLKSR.bit.DFLLRDY) {}
132132
while (GCLK->STATUS.bit.SYNCBUSY) {}
133+
134+
// Wait for the fine lock on the DFLL.
135+
while (!SYSCTRL->PCLKSR.bit.DFLLLCKC || !SYSCTRL->PCLKSR.bit.DFLLLCKF) {}
133136
}
134137

135138
static void init_clock_source_dfll48m_usb(void) {

0 commit comments

Comments
 (0)