Skip to content

Commit 20a95b2

Browse files
nspsckdpgeorge
authored andcommitted
stm32/system_stm32: Allow selection of OSPI clock source.
Added a #if-block to `system_stm32.c` to check whether `MICROPY_HW_RCC_OSPI_CLKSOURCE` is defined. If that is the case, the clock source for the OSPI will be changed to the specified source. Signed-off-by: nspsck <[email protected]>
1 parent bd4aaa7 commit 20a95b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ports/stm32/system_stm32.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,11 @@ MP_WEAK void SystemClock_Config(void) {
461461
PeriphClkInitStruct.QspiClockSelection = MICROPY_HW_RCC_QSPI_CLKSOURCE;
462462
#endif
463463

464+
#if defined(MICROPY_HW_RCC_OSPI_CLKSOURCE)
465+
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_OSPI;
466+
PeriphClkInitStruct.OspiClockSelection = MICROPY_HW_RCC_OSPI_CLKSOURCE;
467+
#endif
468+
464469
#if defined(MICROPY_HW_RCC_SPI123_CLKSOURCE)
465470
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_SPI123;
466471
PeriphClkInitStruct.Spi123ClockSelection = MICROPY_HW_RCC_SPI123_CLKSOURCE;

0 commit comments

Comments
 (0)