Guest User

Untitled

a guest
Feb 7th, 2020
308
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. void clock_init(void)
  2. {
  3. // enable HSI
  4. RCC->CR |= RCC_CR_HSION;
  5. while ((RCC->CR & RCC_CR_HSIRDY) ==0);
  6.  
  7. RCC->CFGR &=~RCC_CFGR_SW;
  8. RCC->CFGR |= RCC_CFGR_SW_HSI;
  9. while((RCC->CFGR & RCC_CFGR_SWS_HSI) != RCC_CFGR_SWS_HSI);
  10.  
  11. // ==========================================
  12.  
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment