File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
targets/TARGET_STM/TARGET_STM32L1 Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,11 @@ void analogin_init(analogin_t *obj, PinName pin)
7676 if (HAL_ADC_Init (& obj -> handle ) != HAL_OK ) {
7777 error ("Cannot initialize ADC" );
7878 }
79+ }
80+
81+ uint16_t adc_read (analogin_t * obj )
82+ {
83+ ADC_ChannelConfTypeDef sConfig = {0 };
7984
8085 if (!__HAL_RCC_GET_FLAG (RCC_FLAG_HSIRDY )) {
8186 // Enable the HSI (to clock the ADC)
@@ -86,11 +91,6 @@ void analogin_init(analogin_t *obj, PinName pin)
8691 RCC_OscInitStruct .HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT ;
8792 HAL_RCC_OscConfig (& RCC_OscInitStruct );
8893 }
89- }
90-
91- uint16_t adc_read (analogin_t * obj )
92- {
93- ADC_ChannelConfTypeDef sConfig = {0 };
9494
9595 // Configure ADC channel
9696 sConfig .Rank = ADC_REGULAR_RANK_1 ;
You can’t perform that action at this time.
0 commit comments