diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2018-06-06 12:02:17 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2018-06-08 12:56:32 -0700 |
| commit | 383bf9a59e1672684169b4afe57671a639fe12ad (patch) | |
| tree | d45ac25a2fb236d5e4c93aea926cdd38b0013cc3 | |
| parent | 07a8899c726a53011ead19d4e92cd8ccc09c1e03 (diff) | |
Wait for the DFLL to be stable.
| -rw-r--r-- | ports/atmel-samd/peripherals/samd21/clocks.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ports/atmel-samd/peripherals/samd21/clocks.c b/ports/atmel-samd/peripherals/samd21/clocks.c index 51b7ad993..422290e8b 100644 --- a/ports/atmel-samd/peripherals/samd21/clocks.c +++ b/ports/atmel-samd/peripherals/samd21/clocks.c @@ -130,6 +130,9 @@ static void init_clock_source_dfll48m_xosc(void) { SYSCTRL_DFLLCTRL_ENABLE; while (!SYSCTRL->PCLKSR.bit.DFLLRDY) {} while (GCLK->STATUS.bit.SYNCBUSY) {} + + // Wait for the fine lock on the DFLL. + while (!SYSCTRL->PCLKSR.bit.DFLLLCKC || !SYSCTRL->PCLKSR.bit.DFLLLCKF) {} } static void init_clock_source_dfll48m_usb(void) { |
