Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /* Configure the main PLL clock source, multiplication and division factors. */
  2. __HAL_RCC_PLL_CONFIG(RCC_OscInitStruct->PLL.PLLSource,
  3. RCC_OscInitStruct->PLL.PLLMUL,
  4. RCC_OscInitStruct->PLL.PLLDIV);
  5. /* Enable the main PLL. */
  6. __HAL_RCC_PLL_ENABLE();
  7.  
  8. /* Get timeout */
  9. tickstart = HAL_GetTick();
  10.  
  11. /* Wait till PLL is ready */
  12. while(__HAL_RCC_GET_FLAG(RCC_FLAG_PLLRDY) == RESET)
  13. {
  14. if((HAL_GetTick() - tickstart ) > RCC_PLL_TIMEOUT_VALUE)
  15. {
  16. return HAL_TIMEOUT;
  17. }
  18. }
  19.  
  20. /* Enter Stop Mode */
  21. HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI);
  22.  
  23. /* Stop interrupt that woke us up */
  24. int ret = HAL_LPTIM_TimeOut_Stop_IT(&LptimHandle);
  25. SystemDisableWakeupCounter();
  26.  
  27. /* Configures system clock after wake-up from STOP: enable HSI, PLL and select
  28. PLL as system clock source (HSI and PLL are disabled automatically in STOP mode) */
  29. SystemClockConfig_STOP();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement