Turn off HSI earlier
This commit is contained in:
@@ -17,6 +17,9 @@ static void system_clock_init(void) {
|
||||
PWR->CR &= ~(PWR_CR_VOS_MASK << PWR_CR_VOS_BIT);
|
||||
PWR->CR |= (PWR_SCALE3 << PWR_CR_VOS_BIT);
|
||||
|
||||
// Turn off HSI (which is on by default)
|
||||
RCC->CR &= ~RCC_CR_HSION_ON;
|
||||
|
||||
// Turn on HSE
|
||||
RCC->CR |= RCC_CR_HSEON_ON;
|
||||
|
||||
@@ -68,9 +71,6 @@ static void system_clock_init(void) {
|
||||
// Wait indefinitely for PLL clock to be selected
|
||||
// TODO indicate error/timeout somehow?
|
||||
while (((RCC->CFGR >> RCC_CFGR_SWS_BIT) & RCC_CFGR_SWS_MASK) != RCC_CFGR_SWS_PLL);
|
||||
|
||||
// Turn off HSI (which is on by default)
|
||||
RCC->CR &= ~RCC_CR_HSION_ON;
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
|
||||
Reference in New Issue
Block a user