Skip to content

Commit 98dde27

Browse files
committed
fix(wb): missing ADC_SUPPORT_2_5_MSPS for analog configuration
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 3fe0c1e commit 98dde27

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: libraries/SrcWrapper/src/stm32/analog.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
860860
#if !defined(STM32F1xx) && !defined(STM32F2xx) && !defined(STM32F3xx) && \
861861
!defined(STM32F4xx) && !defined(STM32F7xx) && !defined(STM32G4xx) && \
862862
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32L5xx) && \
863-
!defined(STM32MP1xx) && !defined(STM32WBxx)
863+
!defined(STM32MP1xx) && !defined(STM32WBxx) || defined(ADC_SUPPORT_2_5_MSPS)
864864
AdcHandle.Init.LowPowerAutoPowerOff = DISABLE; /* ADC automatically powers-off after a conversion and automatically wakes-up when a new conversion is triggered */
865865
#endif
866866
#ifdef ADC_CHANNELS_BANK_B
@@ -874,7 +874,7 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
874874
#endif
875875
AdcHandle.Init.DiscontinuousConvMode = DISABLE; /* Parameter discarded because sequencer is disabled */
876876
#if !defined(STM32F0xx) && !defined(STM32G0xx) && !defined(STM32L0xx) && \
877-
!defined(STM32WLxx)
877+
!defined(STM32WLxx) && !defined(ADC_SUPPORT_2_5_MSPS)
878878
AdcHandle.Init.NbrOfDiscConversion = 0; /* Parameter discarded because sequencer is disabled */
879879
#endif
880880
AdcHandle.Init.ExternalTrigConv = ADC_SOFTWARE_START; /* Software start to trig the 1st conversion manually, without external event */
@@ -898,7 +898,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
898898
#if defined(STM32F0xx)
899899
AdcHandle.Init.SamplingTimeCommon = samplingTime;
900900
#endif
901-
#if defined(STM32G0xx) || defined(STM32U5xx) || defined(STM32WLxx)
901+
#if defined(STM32G0xx) || defined(STM32U5xx) || defined(STM32WLxx) || \
902+
defined(ADC_SUPPORT_2_5_MSPS)
902903
AdcHandle.Init.SamplingTimeCommon1 = samplingTime; /* Set sampling time common to a group of channels. */
903904
AdcHandle.Init.SamplingTimeCommon2 = samplingTime; /* Set sampling time common to a group of channels, second common setting possible.*/
904905
#endif
@@ -908,7 +909,7 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
908909
#endif
909910
#if !defined(STM32F0xx) && !defined(STM32F1xx) && !defined(STM32F2xx) && \
910911
!defined(STM32F3xx) && !defined(STM32F4xx) && !defined(STM32F7xx) && \
911-
!defined(STM32L1xx)
912+
!defined(STM32L1xx) && !defined(ADC_SUPPORT_2_5_MSPS)
912913
AdcHandle.Init.OversamplingMode = DISABLE;
913914
/* AdcHandle.Init.Oversample ignore for STM32L0xx as oversampling disabled */
914915
/* AdcHandle.Init.Oversampling ignored for other as oversampling disabled */

0 commit comments

Comments
 (0)