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)
76
76
if (HAL_ADC_Init (& obj -> handle ) != HAL_OK ) {
77
77
error ("Cannot initialize ADC" );
78
78
}
79
+ }
80
+
81
+ uint16_t adc_read (analogin_t * obj )
82
+ {
83
+ ADC_ChannelConfTypeDef sConfig = {0 };
79
84
80
85
if (!__HAL_RCC_GET_FLAG (RCC_FLAG_HSIRDY )) {
81
86
// Enable the HSI (to clock the ADC)
@@ -86,11 +91,6 @@ void analogin_init(analogin_t *obj, PinName pin)
86
91
RCC_OscInitStruct .HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT ;
87
92
HAL_RCC_OscConfig (& RCC_OscInitStruct );
88
93
}
89
- }
90
-
91
- uint16_t adc_read (analogin_t * obj )
92
- {
93
- ADC_ChannelConfTypeDef sConfig = {0 };
94
94
95
95
// Configure ADC channel
96
96
sConfig .Rank = ADC_REGULAR_RANK_1 ;
You can’t perform that action at this time.
0 commit comments