diff options
Diffstat (limited to 'Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c')
-rw-r--r-- | Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c b/Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c index 16e895879..952fe62fd 100644 --- a/Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c +++ b/Projects/STM32WB5MM-DK/Examples/QSPI/QSPI_ExecuteInPlace/Src/main.c @@ -8,13 +8,12 @@ ****************************************************************************** * @attention * - * <h2><center>© Copyright (c) 2020 STMicroelectronics. - * All rights reserved.</center></h2> + * Copyright (c) 2020-2021 STMicroelectronics. + * All rights reserved. * - * This software component is licensed by ST under BSD 3-Clause license, - * the "License"; You may not use this file except in compliance with the - * License. You may obtain a copy of the License at: - * opensource.org/licenses/BSD-3-Clause + * This software is licensed under terms that can be found in the LICENSE file + * in the root directory of this software component. + * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ @@ -64,6 +63,7 @@ __IO uint8_t CmdCplt, RxCplt, TxCplt, StatusMatch; /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); +void PeriphCommonClock_Config(void); static void MX_GPIO_Init(void); static void MX_DMA_Init(void); static void MX_QUADSPI_Init(void); @@ -116,6 +116,9 @@ int main(void) /* Configure the system clock */ SystemClock_Config(); +/* Configure the peripherals common clocks */ + PeriphCommonClock_Config(); + /* USER CODE BEGIN SysInit */ /* Set default off value for each leds */ aPwmLedGsData[PWM_LED_RED] = PWM_LED_GSDATA_OFF; @@ -306,7 +309,6 @@ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; /** Configure the main internal regulator output voltage */ @@ -347,11 +349,22 @@ void SystemClock_Config(void) { Error_Handler(); } - /** Initializes the peripherals clocks +} + +/** + * @brief Peripherals Common Clock Configuration + * @retval None + */ +void PeriphCommonClock_Config(void) +{ + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + + /** Initializes the peripherals clock */ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_SMPS; PeriphClkInitStruct.SmpsClockSelection = RCC_SMPSCLKSOURCE_HSI; PeriphClkInitStruct.SmpsDivSelection = RCC_SMPSCLKDIV_RANGE1; + if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) { Error_Handler(); @@ -625,5 +638,3 @@ void assert_failed(uint8_t *file, uint32_t line) /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |