Skip to content
Snippets Groups Projects
Unverified Commit 54e57c0a authored by Dylan Laduranty's avatar Dylan Laduranty Committed by GitHub
Browse files

Merge pull request #8423 from photonthunder/samd21_DFLL

samd21/cpu DFLL lock loop error
parents 2ad122e1 0f011d53
No related branches found
No related tags found
No related merge requests found
...@@ -161,11 +161,10 @@ static void clk_init(void) ...@@ -161,11 +161,10 @@ static void clk_init(void)
} }
SYSCTRL->DFLLCTRL.bit.ENABLE = 1; SYSCTRL->DFLLCTRL.bit.ENABLE = 1;
while ((SYSCTRL->PCLKSR.reg & (SYSCTRL_PCLKSR_DFLLRDY | uint32_t mask = SYSCTRL_PCLKSR_DFLLRDY |
SYSCTRL_PCLKSR_DFLLLCKF | SYSCTRL_PCLKSR_DFLLLCKF |
SYSCTRL_PCLKSR_DFLLLCKC)) == 0) { SYSCTRL_PCLKSR_DFLLLCKC;
/* Wait for DFLLLXXX sync */ while ((SYSCTRL->PCLKSR.reg & mask) != mask) { } /* Wait for DFLL lock */
}
/* select the DFLL as source for clock generator 0 (CPU core clock) */ /* select the DFLL as source for clock generator 0 (CPU core clock) */
GCLK->GENDIV.reg = (GCLK_GENDIV_DIV(1U) | GCLK_GENDIV_ID(0)); GCLK->GENDIV.reg = (GCLK_GENDIV_DIV(1U) | GCLK_GENDIV_ID(0));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment