@@ -36,30 +36,7 @@ void analogin_pll_configuration(void)
36
36
37
37
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0 };
38
38
PeriphClkInitStruct .PeriphClockSelection = RCC_PERIPHCLK_ADC ;
39
- if (__HAL_RCC_GET_PLL_OSCSOURCE () == RCC_PLLSOURCE_HSI ) {
40
- PeriphClkInitStruct .PLL2 .PLL2M = 16 ;
41
- PeriphClkInitStruct .PLL2 .PLL2N = 120 ;
42
- } else {
43
- #if HSE_VALUE == 8000000
44
- PeriphClkInitStruct .PLL2 .PLL2M = 2 ;
45
- PeriphClkInitStruct .PLL2 .PLL2N = 120 ;
46
- #elif HSE_VALUE == 16000000
47
- PeriphClkInitStruct .PLL2 .PLL2M = 2 ;
48
- PeriphClkInitStruct .PLL2 .PLL2N = 60 ;
49
- #elif HSE_VALUE == 25000000
50
- PeriphClkInitStruct .PLL2 .PLL2M = 5 ;
51
- PeriphClkInitStruct .PLL2 .PLL2N = 96 ;
52
- #else
53
- error ("HSE not configured properly" );
54
- #endif
55
- }
56
- PeriphClkInitStruct .PLL2 .PLL2P = 3 ;
57
- PeriphClkInitStruct .PLL2 .PLL2Q = 4 ;
58
- PeriphClkInitStruct .PLL2 .PLL2R = 2 ;
59
- PeriphClkInitStruct .PLL2 .PLL2RGE = RCC_PLL2VCIRANGE_1 ;
60
- PeriphClkInitStruct .PLL2 .PLL2VCOSEL = RCC_PLL2VCOWIDE ;
61
- PeriphClkInitStruct .PLL2 .PLL2FRACN = 0 ;
62
- PeriphClkInitStruct .AdcClockSelection = RCC_ADCCLKSOURCE_PLL2 ;
39
+ PeriphClkInitStruct .AdcClockSelection = RCC_ADCCLKSOURCE_CLKP ;
63
40
if (HAL_RCCEx_PeriphCLKConfig (& PeriphClkInitStruct ) != HAL_OK ) {
64
41
error ("analogin_init HAL_RCCEx_PeriphCLKConfig" );
65
42
}
0 commit comments