We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4378689 commit fa68d43Copy full SHA for fa68d43
targets/TARGET_STM/TARGET_STM32L0/analogin_device.c
@@ -175,13 +175,13 @@ uint16_t adc_read(analogin_t *obj)
175
HAL_ADC_Start(&obj->handle); // Start conversion
176
177
// Wait end of conversion and get value
178
- uint16_t adcValue = 0;
+ uint16_t adcValue = 0;
179
if (HAL_ADC_PollForConversion(&obj->handle, 10) == HAL_OK) {
180
adcValue = (uint16_t)HAL_ADC_GetValue(&obj->handle);
181
- }
182
- sConfig.Rank = ADC_RANK_NONE;
183
- HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
184
- return adcValue;
+ }
+ sConfig.Rank = ADC_RANK_NONE;
+ HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
+ return adcValue;
185
}
186
187
#endif
0 commit comments