Skip to content

Commit a3862e7

Browse files
committed
stm32/powerctrlboot: Allow PLL1 Q and R outputs to be enabled on H5.
If a board needs these outputs then it can define MICROPY_HW_CLK_PLLQ/R. It saves power to not enable them if they are not needed. Signed-off-by: Damien George <[email protected]>
1 parent fa68523 commit a3862e7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ports/stm32/powerctrlboot.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,21 @@ void SystemClock_Config(void) {
218218

219219
// Configure PLL1 for use as system clock.
220220
LL_RCC_PLL1_ConfigDomain_SYS(pll1_source, MICROPY_HW_CLK_PLLM, MICROPY_HW_CLK_PLLN, MICROPY_HW_CLK_PLLP);
221-
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
222-
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
223221
LL_RCC_PLL1_SetFRACN(MICROPY_HW_CLK_PLLFRAC);
224222
LL_RCC_PLL1_SetVCOInputRange(MICROPY_HW_CLK_PLLVCI_LL);
225223
LL_RCC_PLL1_SetVCOOutputRange(MICROPY_HW_CLK_PLLVCO_LL);
226224
LL_RCC_PLL1P_Enable();
227225

226+
#if defined(MICROPY_HW_CLK_PLLQ)
227+
LL_RCC_PLL1_SetQ(MICROPY_HW_CLK_PLLQ);
228+
LL_RCC_PLL1Q_Enable();
229+
#endif
230+
231+
#if defined(MICROPY_HW_CLK_PLLR)
232+
LL_RCC_PLL1_SetR(MICROPY_HW_CLK_PLLR);
233+
LL_RCC_PLL1R_Enable();
234+
#endif
235+
228236
// Enable PLL1.
229237
LL_RCC_PLL1_Enable();
230238
while (!LL_RCC_PLL1_IsReady()) {

0 commit comments

Comments
 (0)