stm32: Simplify CCIPR2 register assignment on stm32g0

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-03-09 13:12:47 -05:00
parent d75154d695
commit 4ce2d379bb
1 changed files with 2 additions and 5 deletions

View File

@ -94,11 +94,8 @@ clock_setup(void)
while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != (2 << RCC_CFGR_SWS_Pos)) while ((RCC->CFGR & RCC_CFGR_SWS_Msk) != (2 << RCC_CFGR_SWS_Pos))
; ;
// Enable USB clock // Use PLLQCLK for USB (setting USBSEL=2 works in practice)
if (CONFIG_USBSERIAL) { RCC->CCIPR2 = RCC_CCIPR2_USBSEL_1;
// PLLQCLK
RCC->CCIPR2 |= RCC_CCIPR2_USBSEL_1;
}
} }