Skip to content

Commit 7e56d54

Browse files
committed
fix(analog): instance for H7 and MP1 internal channels
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent fae44bf commit 7e56d54

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libraries/SrcWrapper/src/stm32/analog.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,12 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
781781
uint32_t bank = 0;
782782

783783
if ((pin & PADC_BASE) && (pin < ANA_START)) {
784-
#if defined(STM32H7xx)
784+
#if defined(STM32H7xx) || defined(STM32MP1xx)
785+
#ifdef ADC3
785786
AdcHandle.Instance = ADC3;
787+
#else
788+
AdcHandle.Instance = ADC2;
789+
#endif
786790
#else
787791
AdcHandle.Instance = ADC1;
788792
#if defined(ADC5) && defined(ADC_CHANNEL_TEMPSENSOR_ADC5)

0 commit comments

Comments
 (0)