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:
Steins7 2024-11-03 22:23:26 +01:00
parent daf5920814
commit 4df0ba5c6a

View File

@ -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) {