Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void clock_init(void)
- {
- // enable HSI
- RCC->CR |= RCC_CR_HSION;
- while ((RCC->CR & RCC_CR_HSIRDY) ==0);
- RCC->CFGR &=~RCC_CFGR_SW;
- RCC->CFGR |= RCC_CFGR_SW_HSI;
- while((RCC->CFGR & RCC_CFGR_SWS_HSI) != RCC_CFGR_SWS_HSI);
- // ==========================================
- }
Advertisement
Add Comment
Please, Sign In to add comment