Skip to content

Commit 67b1c81

Browse files
committed
stm32/powerctrlboot: Allow using PLL3 for USB clock on H5 MCU's.
A board should enable MICROPY_HW_CLK_USE_PLL3_FOR_USB to use this feature. Signed-off-by: Damien George <[email protected]>
1 parent 60e0ef6 commit 67b1c81

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/stm32/powerctrlboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ void SystemClock_Config(void) {
251251
powerctrl_config_systick();
252252

253253
// USB clock configuration, either HSI48 or PLL3.
254-
#if 1
254+
#if MICROPY_HW_ENABLE_USB && !MICROPY_HW_CLK_USE_PLL3_FOR_USB
255255

256256
// Enable HSI48.
257257
LL_RCC_HSI48_Enable();
@@ -267,7 +267,7 @@ void SystemClock_Config(void) {
267267
| __HAL_RCC_CRS_RELOADVALUE_CALCULATE(48000000, 1000) << CRS_CFGR_RELOAD_Pos;
268268
CRS->CR = 0x20 << CRS_CR_TRIM_Pos | CRS_CR_AUTOTRIMEN | CRS_CR_CEN;
269269

270-
#else
270+
#elif MICROPY_HW_ENABLE_USB && MICROPY_HW_CLK_USE_PLL3_FOR_USB
271271

272272
// Configure PLL3 for use by USB at Q=48MHz.
273273
LL_RCC_PLL3_SetSource(LL_RCC_PLL3SOURCE_HSE);

0 commit comments

Comments
 (0)