1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-26 09:45:33 +03:00

Make sure defining/not defining USE_UNDERCLOCK doesn't break the functionality

This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2018-02-12 22:24:02 +10:00
parent 8e77390fb2
commit cc90e3b9a7
3 changed files with 15 additions and 2 deletions

View file

@ -152,6 +152,12 @@ bool isMPUSoftReset(void)
return false; return false;
} }
void systemClockSetup(uint8_t cpuUnderclock)
{
(void)cpuUnderclock;
// This is a stub
}
void systemInit(void) void systemInit(void)
{ {
SetSysClock(); SetSysClock();

View file

@ -146,10 +146,17 @@ bool isMPUSoftReset(void)
return false; return false;
} }
void systemClockSetup(uint8_t cpuUnderclock)
{
(void)cpuUnderclock;
// This is a stub
}
void systemInit(void) void systemInit(void)
{ {
checkForBootLoaderRequest(); checkForBootLoaderRequest();
//Called by SystemInit from startup_stm32f7xx.s
//SystemClock_Config(); //SystemClock_Config();
// Configure NVIC preempt/priority groups // Configure NVIC preempt/priority groups

View file

@ -180,6 +180,7 @@ void init(void)
printfSupportInit(); printfSupportInit();
// Initialize system and CPU clocks to their initial values
systemInit(); systemInit();
// initialize IO (needed for all IO operations) // initialize IO (needed for all IO operations)
@ -197,9 +198,8 @@ void init(void)
ensureEEPROMContainsValidData(); ensureEEPROMContainsValidData();
readEEPROM(); readEEPROM();
#ifdef USE_UNDERCLOCK // Re-initialize system clock to their final values (if necessary)
systemClockSetup(systemConfig()->cpuUnderclock); systemClockSetup(systemConfig()->cpuUnderclock);
#endif
i2cSetSpeed(systemConfig()->i2c_speed); i2cSetSpeed(systemConfig()->i2c_speed);