@@ -185,7 +185,7 @@ void SystemInit(void)
185185 * in voltage and temperature.
186186 *
187187 * (***) HSE_VALUE is a constant defined in stm32_external_env.h file (default value
188- * 24 MHz), user has to ensure that HSE_VALUE is same as the real
188+ * 24 MHz or 48MHz ), user has to ensure that HSE_VALUE is same as the real
189189 * frequency of the crystal used. Otherwise, this function can
190190 * have wrong result.
191191 *
@@ -200,15 +200,9 @@ void SystemCoreClockUpdate(void)
200200 /* Get SYSCLK source -------------------------------------------------------*/
201201 switch ((RCC -> CFGR1 & RCC_CFGR1_SWS ) >> RCC_CFGR1_SWS_Pos )
202202 {
203- #if defined(RCC_CR1_HSIDIV4ON )
204- case 0x00UL : /* HSIDIV4 used as system clock source */
205- SystemCoreClock = (uint32_t )(HSI_VALUE / 4U );
206- break ;
207- #else
208203 case 0x00UL : /* HSIDIV3 used as system clock source */
209204 SystemCoreClock = (uint32_t )(HSI_VALUE / 3U );
210205 break ;
211- #endif /* RCC_CR1_HSIDIV4ON */
212206
213207 case 0x01UL : /* HSIS used as system clock source */
214208 SystemCoreClock = (uint32_t ) HSI_VALUE ;
@@ -229,27 +223,6 @@ void SystemCoreClockUpdate(void)
229223
230224 switch (psifreq )
231225 {
232- #if defined(RCC_CR1_HSIDIV4ON )
233- case 0x00UL :
234- SystemCoreClock = (uint32_t )200000000U ; /* 200 MHz */
235- break ;
236-
237- case 0x01UL :
238- SystemCoreClock = (uint32_t )144000000U ; /* 144 MHz */
239- break ;
240-
241- case 0x02UL :
242- SystemCoreClock = (uint32_t )160000000U ; /* 160 MHz */
243- break ;
244-
245- case 0x03UL :
246- SystemCoreClock = (uint32_t )192000000U ; /* 192 MHz */
247- break ;
248-
249- default :
250- SystemCoreClock = (uint32_t )200000000U ; /* 200 MHz */
251- break ;
252- #else
253226 case 0x00UL :
254227 SystemCoreClock = (uint32_t )100000000U ; /* 100 MHz */
255228 break ;
@@ -266,17 +239,12 @@ void SystemCoreClockUpdate(void)
266239 default :
267240 SystemCoreClock = (uint32_t )100000000U ; /* 100 MHz */
268241 break ;
269- #endif /* RCC_CR1_HSIDIV4ON */
270242 }
271243 }
272244 break ;
273245
274246 default :
275- #if defined(RCC_CR1_HSIDIV4ON )
276- SystemCoreClock = (uint32_t )(HSI_VALUE / 4U );
277- #else
278247 SystemCoreClock = (uint32_t )(HSI_VALUE / 3U );
279- #endif /* RCC_CR1_HSIDIV4ON */
280248 break ;
281249 }
282250 /* Compute HCLK clock frequency --------------------------------------------*/
0 commit comments