Skip to content

Commit 2130494

Browse files
committed
[MP1] Update analog
Signed-off-by: Frederic Pillon <[email protected]>
1 parent eeebca2 commit 2130494

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cores/arduino/stm32/analog.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ uint16_t adc_read_value(PinName pin)
916916
!defined(STM32WBxx) && !defined(STM32F373xC) && !defined(STM32F378xx)
917917
AdcChannelConf.Offset = 0; /* Parameter discarded because offset correction is disabled */
918918
#endif
919-
#if defined (STM32H7xx)
919+
#if defined (STM32H7xx) || defined(STM32MP1xx)
920920
AdcChannelConf.OffsetRightShift = DISABLE; /* No Right Offset Shift */
921921
AdcChannelConf.OffsetSignedSaturation = DISABLE; /* Signed saturation feature is not used */
922922
#endif
@@ -929,12 +929,13 @@ uint16_t adc_read_value(PinName pin)
929929

930930
#if defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32F3xx) || \
931931
defined(STM32G0xx) || defined(STM32G4xx) || defined(STM32H7xx) || \
932-
defined(STM32L0xx) || defined(STM32L4xx) || defined(STM32WBxx)
932+
defined(STM32L0xx) || defined(STM32L4xx) || defined(STM32MP1xx) || \
933+
defined(STM32WBxx)
933934
/*##-2.1- Calibrate ADC then Start the conversion process ####################*/
934935
#if defined(STM32F0xx) || defined(STM32G0xx) || defined(STM32F1xx) || \
935936
defined(STM32F373xC) || defined(STM32F378xx)
936937
if (HAL_ADCEx_Calibration_Start(&AdcHandle) != HAL_OK)
937-
#elif defined (STM32H7xx)
938+
#elif defined (STM32H7xx) || defined(STM32MP1xx)
938939
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_CALIB_OFFSET, ADC_SINGLE_ENDED) != HAL_OK)
939940
#else
940941
if (HAL_ADCEx_Calibration_Start(&AdcHandle, ADC_SINGLE_ENDED) != HAL_OK)

0 commit comments

Comments
 (0)