1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00

Adjustable OC for F405 and F411

This commit is contained in:
Andrey Mironov 2018-02-17 14:12:16 +03:00
parent e596f9a7d1
commit ac26c975dd
11 changed files with 93 additions and 47 deletions

View file

@ -353,18 +353,8 @@ void init(void)
}
#endif
#if defined(STM32F4) && !defined(DISABLE_OVERCLOCK)
// If F4 Overclocking is set and System core clock is not correct a reset is forced
if (systemConfig()->cpu_overclock && SystemCoreClock != OC_FREQUENCY_HZ) {
*((uint32_t *)0x2001FFF8) = 0xBABEFACE; // 128KB SRAM STM32F4XX
__disable_irq();
NVIC_SystemReset();
} else if (!systemConfig()->cpu_overclock && SystemCoreClock == OC_FREQUENCY_HZ) {
*((uint32_t *)0x2001FFF8) = 0x0; // 128KB SRAM STM32F4XX
__disable_irq();
NVIC_SystemReset();
}
#ifdef USE_OVERCLOCK
OverclockRebootIfNecessary(systemConfig()->cpu_overclock);
#endif
delay(100);