Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Configure the main PLL clock source, multiplication and division factors. */
- __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource,
- RCC_OscInitStruct->PLL.PLLMUL,
- RCC_OscInitStruct->PLL.PLLDIV);
- /* Enable the main PLL. */
- __HAL_RCC_PLL_ENABLE();
- /* Get timeout */
- tickstart = HAL_GetTick();
- /* Wait till PLL is ready */
- while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
- {
- if((HAL_GetTick() - tickstart ) > RCC_PLL_TIMEOUT_VALUE)
- {
- return HAL_TIMEOUT;
- }
- }
- /* Enter Stop Mode */
- HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
- /* Stop interrupt that woke us up */
- int ret = HAL_LPTIM_TimeOut_Stop_IT(&LptimHandle);
- SystemDisableWakeupCounter();
- /* Configures system clock after wake-up from STOP: enable HSI, PLL and select
- PLL as system clock source (HSI and PLL are disabled automatically in STOP mode) */
- SystemClockConfig_STOP();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement