Skip to content

Commit ef20dc8

Browse files
committed
[ADC] Internal channels reset after read
Internal channels use is enabling ADC "internal path" which needs to be disabled after measurement Signed-off-by: Frederic Pillon <[email protected]>
1 parent 2ddfe71 commit ef20dc8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cores/arduino/stm32/analog.c

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "analog.h"
4040
#include "timer.h"
4141
#include "PinAF_STM32F1.h"
42+
#include "stm32yyxx_ll_adc.h"
4243

4344
#ifdef __cplusplus
4445
extern "C" {
@@ -809,6 +810,8 @@ uint16_t adc_read_value(PinName pin)
809810
return 0;
810811
}
811812

813+
LL_ADC_SetCommonPathInternalCh(__LL_ADC_COMMON_INSTANCE(AdcHandle.Instance), LL_ADC_PATH_INTERNAL_NONE);
814+
812815
return uhADCxConvertedValue;
813816
}
814817
#endif /* HAL_ADC_MODULE_ENABLED */

0 commit comments

Comments
 (0)