Fix RCC's speed preset not working in release
Since rcc_configure should always be called before anything else, short timing depends on hard coded loops. These are too fast in release...
This commit is contained in:
parent
daf5920814
commit
4df0ba5c6a
@ -163,7 +163,7 @@ static void apply_speed_preset(void)
|
||||
|
||||
//try enabling HSE, fallback to HSI if HSE fails
|
||||
regs->CR.HSEON = 1;
|
||||
for (uint32_t i=0; i<1000; ++i) {
|
||||
for (uint32_t i=0; i<10000; ++i) {
|
||||
__asm__("nop");
|
||||
}
|
||||
if (regs->CR.HSERDY == 0x1) {
|
||||
@ -175,7 +175,7 @@ static void apply_speed_preset(void)
|
||||
//configure PLL, fallback to HSI if PLL fails
|
||||
regs->CFGR.PLLMUL = 0x7; //PLL x9
|
||||
regs->CR.PLLON = 1;
|
||||
for (uint32_t i=0; i<1000; ++i) {
|
||||
for (uint32_t i=0; i<10000; ++i) {
|
||||
__asm__("nop");
|
||||
}
|
||||
if (regs->CR.PLLRDY != 0x1) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user