@@ -164,23 +164,22 @@ WEAK void SystemClock_Config(void)
164
164
RCC_OscInitTypeDef RCC_OscInitStruct;
165
165
RCC_ClkInitTypeDef RCC_ClkInitStruct;
166
166
167
- /* * Initializes the CPU, AHB and APB busses clocks
168
- */
169
- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE ;
170
- RCC_OscInitStruct.HSEState = RCC_HSE_ON ;
167
+ /* Initializes the CPU, AHB and APB busses clocks */
168
+ RCC_OscInitStruct. OscillatorType = RCC_OSCILLATORTYPE_HSI;
169
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON ;
170
+ RCC_OscInitStruct.HSICalibrationValue = 16 ;
171
171
RCC_OscInitStruct.PLL .PLLState = RCC_PLL_ON;
172
- RCC_OscInitStruct.PLL .PLLSource = RCC_PLLSOURCE_HSE ;
173
- RCC_OscInitStruct.PLL .PLLM = 8 ;
174
- RCC_OscInitStruct.PLL .PLLN = 240 ;
172
+ RCC_OscInitStruct.PLL .PLLSource = RCC_PLLSOURCE_HSI ;
173
+ RCC_OscInitStruct.PLL .PLLM = 13 ;
174
+ RCC_OscInitStruct.PLL .PLLN = 195 ;
175
175
RCC_OscInitStruct.PLL .PLLP = RCC_PLLP_DIV2;
176
176
RCC_OscInitStruct.PLL .PLLQ = 5 ;
177
177
if (HAL_RCC_OscConfig (&RCC_OscInitStruct) != HAL_OK)
178
178
{
179
- while ( 1 );
179
+ _Error_Handler (__FILE__, __LINE__ );
180
180
}
181
181
182
- /* *Initializes the CPU, AHB and APB busses clocks
183
- */
182
+ /* Initializes the CPU, AHB and APB busses clocks */
184
183
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
185
184
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
186
185
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
@@ -190,15 +189,13 @@ WEAK void SystemClock_Config(void)
190
189
191
190
if (HAL_RCC_ClockConfig (&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
192
191
{
193
- while ( 1 );
192
+ _Error_Handler (__FILE__, __LINE__ );
194
193
}
195
194
196
- /* *Configure the Systick interrupt time
197
- */
195
+ /* Configure the Systick interrupt time */
198
196
HAL_SYSTICK_Config (HAL_RCC_GetHCLKFreq ()/1000 );
199
197
200
- /* *Configure the Systick
201
- */
198
+ /* Configure the Systick */
202
199
HAL_SYSTICK_CLKSourceConfig (SYSTICK_CLKSOURCE_HCLK);
203
200
204
201
/* SysTick_IRQn interrupt configuration */
0 commit comments