File tree 1 file changed +9
-0
lines changed
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -797,7 +797,12 @@ uint16_t adc_read_value(PinName pin)
797
797
#ifdef ADC_DATAALIGN_RIGHT
798
798
AdcHandle.Init .DataAlign = ADC_DATAALIGN_RIGHT; /* Right-alignment for converted data */
799
799
#endif
800
+
801
+ #ifdef ADC_SCAN_SEQ_FIXED
802
+ AdcHandle.Init .ScanConvMode = ADC_SCAN_SEQ_FIXED; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
803
+ #else
800
804
AdcHandle.Init .ScanConvMode = DISABLE; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
805
+ #endif
801
806
#ifdef ADC_EOC_SINGLE_CONV
802
807
AdcHandle.Init .EOCSelection = ADC_EOC_SINGLE_CONV; /* EOC flag picked-up to indicate conversion end */
803
808
#endif
@@ -886,7 +891,11 @@ uint16_t adc_read_value(PinName pin)
886
891
#endif /* STM32L4xx || STM32WBxx */
887
892
return 0 ;
888
893
}
894
+ #ifdef ADC_SCAN_SEQ_FIXED
895
+ AdcChannelConf.Rank = ADC_RANK_CHANNEL_NUMBER; /* Enable the rank of the selected channels when not fully configurable */
896
+ #else
889
897
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
898
+ #endif
890
899
#if !defined(STM32L0xx)
891
900
#if !defined(STM32G0xx)
892
901
AdcChannelConf.SamplingTime = samplingTime; /* Sampling time value to be set for the selected channel */
You can’t perform that action at this time.
0 commit comments