Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Flipper-Zero/STM32CubeWB.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c')
-rw-r--r--Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c b/Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c
index 61d3ab4d9..3f325729c 100644
--- a/Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c
+++ b/Projects/NUCLEO-WB15CC/Examples_LL/ADC/ADC_MultiChannelSingleConversion_Init/Src/main.c
@@ -11,13 +11,12 @@
******************************************************************************
* @attention
*
- * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
- * All rights reserved.</center></h2>
+ * Copyright (c) 2019-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.
*
******************************************************************************
*/
@@ -119,6 +118,7 @@ uint32_t ubAdcGrpRegularSequenceConvCount = 0UL; /* Variable set into ADC interr
/* 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_ADC1_Init(void);
@@ -168,6 +168,9 @@ int main(void)
/* Configure the system clock */
SystemClock_Config();
+/* Configure the peripherals common clocks */
+ PeriphCommonClock_Config();
+
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
@@ -340,7 +343,14 @@ void SystemClock_Config(void)
/* Update CMSIS variable (which can be updated also through SystemCoreClockUpdate function) */
LL_SetSystemCoreClock(64000000);
- LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_HSI);
+}
+
+/**
+ * @brief Peripherals Common Clock Configuration
+ * @retval None
+ */
+void PeriphCommonClock_Config(void)
+{
LL_RCC_SetSMPSClockSource(LL_RCC_SMPS_CLKSOURCE_HSI);
LL_RCC_SetSMPSPrescaler(LL_RCC_SMPS_DIV_1);
LL_RCC_SetRFWKPClockSource(LL_RCC_RFWKP_CLKSOURCE_NONE);
@@ -367,6 +377,8 @@ static void MX_ADC1_Init(void)
LL_GPIO_InitTypeDef GPIO_InitStruct = {0};
+ LL_RCC_SetADCClockSource(LL_RCC_ADC_CLKSOURCE_HSI);
+
/* Peripheral clock enable */
LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_ADC);
@@ -891,5 +903,3 @@ void assert_failed(uint8_t *file, uint32_t line)
/* USER CODE END 6 */
}
#endif /* USE_FULL_ASSERT */
-
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/