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 <teng.jiang94@gmail.com>
This commit is contained in:
@@ -461,6 +461,11 @@ MP_WEAK void SystemClock_Config(void) {
|
||||
PeriphClkInitStruct.QspiClockSelection = MICROPY_HW_RCC_QSPI_CLKSOURCE;
|
||||
#endif
|
||||
|
||||
#if defined(MICROPY_HW_RCC_OSPI_CLKSOURCE)
|
||||
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_OSPI;
|
||||
PeriphClkInitStruct.OspiClockSelection = MICROPY_HW_RCC_OSPI_CLKSOURCE;
|
||||
#endif
|
||||
|
||||
#if defined(MICROPY_HW_RCC_SPI123_CLKSOURCE)
|
||||
PeriphClkInitStruct.PeriphClockSelection |= RCC_PERIPHCLK_SPI123;
|
||||
PeriphClkInitStruct.Spi123ClockSelection = MICROPY_HW_RCC_SPI123_CLKSOURCE;
|
||||
|
||||
Reference in New Issue
Block a user