mirror of https://github.com/ARMmbed/mbed-os.git
Increase MSI clock frequency when exiting deep sleep
This will optimize down the time it takes to restore the clock settings when getting out of deep sleep. If 48MHz is available let's use it, otherwise at least 4MHz should be available for any MCU with MSI.pull/12202/head
parent
b1b0673622
commit
022c0eb7dc
|
@ -98,7 +98,11 @@ static void ForceOscOutofDeepSleep(void)
|
|||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
|
||||
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
|
||||
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
|
||||
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_4; // Intermediate freq, 1MHz range
|
||||
#if defined RCC_MSIRANGE_11
|
||||
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11; // Highest freq, 48MHz range
|
||||
#else
|
||||
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; // 4MHz range
|
||||
#endif
|
||||
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
|
||||
#else /* defined RCC_SYSCLKSOURCE_MSI */
|
||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
|
||||
|
|
Loading…
Reference in New Issue