Fix logic bugs in rcc_wait_for_osc_ready().
Thanks Thomas Otto <tommi@viadmin.org> for the patch!
This commit is contained in:
parent
977f0ef6a0
commit
312db1a301
10
lib/rcc.c
10
lib/rcc.c
@ -121,19 +121,19 @@ void rcc_wait_for_osc_ready(osc_t osc)
|
|||||||
{
|
{
|
||||||
switch (osc) {
|
switch (osc) {
|
||||||
case PLL:
|
case PLL:
|
||||||
while ((RCC_CR & PLLRDY) != 0);
|
while ((RCC_CR & PLLRDY) == 0);
|
||||||
break;
|
break;
|
||||||
case HSE:
|
case HSE:
|
||||||
while ((RCC_CR & HSERDY) != 0);
|
while ((RCC_CR & HSERDY) == 0);
|
||||||
break;
|
break;
|
||||||
case HSI:
|
case HSI:
|
||||||
while ((RCC_CR & HSIRDY) != 0);
|
while ((RCC_CR & HSIRDY) == 0);
|
||||||
break;
|
break;
|
||||||
case LSE:
|
case LSE:
|
||||||
while ((RCC_BDCR & LSERDY) != 0);
|
while ((RCC_BDCR & LSERDY) == 0);
|
||||||
break;
|
break;
|
||||||
case LSI:
|
case LSI:
|
||||||
while ((RCC_CSR & LSIRDY) != 0);
|
while ((RCC_CSR & LSIRDY) == 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user