mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Add F4 overclock possibility
F4 overclock activation via CLI and not automaticaly when Gyro 32k is activated Add condition in target file to alow overclock Replace ALLOW_OVERCLOCK by DISABLE_OVERCLOCK Remanant flag and soft reboot for overclocking
This commit is contained in:
parent
5112ffd4d1
commit
1c2eb3f731
7 changed files with 121 additions and 8 deletions
|
@ -266,6 +266,20 @@ void init(void)
|
|||
ensureEEPROMContainsValidData();
|
||||
readEEPROM();
|
||||
|
||||
#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 != 240000000) {
|
||||
*((uint32_t *)0x2001FFFC) = 0xDEADBABE; // 128KB SRAM STM32F4XX
|
||||
__disable_irq();
|
||||
NVIC_SystemReset();
|
||||
} else if (!systemConfig()->cpu_overclock && SystemCoreClock == 240000000) {
|
||||
*((uint32_t *)0x2001FFFC) = 0x0; // 128KB SRAM STM32F4XX
|
||||
__disable_irq();
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
systemState |= SYSTEM_STATE_CONFIG_LOADED;
|
||||
|
||||
//i2cSetOverclock(masterConfig.i2c_overclock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue