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.
2 parents f73a62a + 03b03fe commit cee2a35Copy full SHA for cee2a35
targets/TARGET_STM/TARGET_STM32F1/analogin_device.c
@@ -177,7 +177,10 @@ uint16_t adc_read(analogin_t *obj)
177
if (HAL_ADC_PollForConversion(&obj->handle, 10) == HAL_OK) {
178
adcValue = (uint16_t)HAL_ADC_GetValue(&obj->handle);
179
}
180
- LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance), LL_ADC_PATH_INTERNAL_NONE);
+
181
+ if (__LL_ADC_COMMON_INSTANCE(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance)) != 0U) {
182
+ LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE((&obj->handle)->Instance), LL_ADC_PATH_INTERNAL_NONE);
183
+ }
184
return adcValue;
185
186
0 commit comments