File tree Expand file tree Collapse file tree 1 file changed +30
-3
lines changed
variants/STM32C0xx/C011J(4-6)M Expand file tree Collapse file tree 1 file changed +30
-3
lines changed Original file line number Diff line number Diff line change 18
18
* @param None
19
19
* @retval None
20
20
*/
21
- WEAK void SystemClock_Config (void )
21
+
22
+ void SystemClock_Config (void )
22
23
{
23
- /* SystemClock_Config can be generated by STM32CubeMX */
24
- #warning "SystemClock_Config() is empty. Default clock at reset is used."
24
+ RCC_OscInitTypeDef RCC_OscInitStruct = {};
25
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
26
+
27
+ /** Initializes the RCC Oscillators according to the specified parameters
28
+ * in the RCC_OscInitTypeDef structure.
29
+ */
30
+ RCC_OscInitStruct .OscillatorType = RCC_OSCILLATORTYPE_HSI ;
31
+ RCC_OscInitStruct .HSIState = RCC_HSI_ON ;
32
+ RCC_OscInitStruct .HSIDiv = RCC_HSI_DIV4 ;
33
+ RCC_OscInitStruct .HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT ;
34
+ if (HAL_RCC_OscConfig (& RCC_OscInitStruct ) != HAL_OK )
35
+ {
36
+ Error_Handler ();
37
+ }
38
+
39
+ /** Initializes the CPU, AHB and APB buses clocks
40
+ */
41
+ RCC_ClkInitStruct .ClockType = RCC_CLOCKTYPE_HCLK |RCC_CLOCKTYPE_SYSCLK
42
+ |RCC_CLOCKTYPE_PCLK1 ;
43
+ RCC_ClkInitStruct .SYSCLKSource = RCC_SYSCLKSOURCE_HSI ;
44
+ RCC_ClkInitStruct .SYSCLKDivider = RCC_SYSCLK_DIV1 ;
45
+ RCC_ClkInitStruct .AHBCLKDivider = RCC_HCLK_DIV1 ;
46
+ RCC_ClkInitStruct .APB1CLKDivider = RCC_APB1_DIV1 ;
47
+
48
+ if (HAL_RCC_ClockConfig (& RCC_ClkInitStruct , FLASH_LATENCY_0 ) != HAL_OK )
49
+ {
50
+ Error_Handler ();
51
+ }
25
52
}
26
53
27
54
#endif /* ARDUINO_GENERIC_* */
You can’t perform that action at this time.
0 commit comments