File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -797,7 +797,11 @@ 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
+ #ifdef ADC_SCAN_SEQ_FIXED
801
+ AdcHandle.Init .ScanConvMode = ADC_SCAN_SEQ_FIXED; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
802
+ #else
800
803
AdcHandle.Init .ScanConvMode = DISABLE; /* Sequencer disabled (ADC conversion on only 1 channel: channel set on rank 1) */
804
+ #endif
801
805
#ifdef ADC_EOC_SINGLE_CONV
802
806
AdcHandle.Init .EOCSelection = ADC_EOC_SINGLE_CONV; /* EOC flag picked-up to indicate conversion end */
803
807
#endif
@@ -886,7 +890,11 @@ uint16_t adc_read_value(PinName pin)
886
890
#endif /* STM32L4xx || STM32WBxx */
887
891
return 0 ;
888
892
}
893
+ #ifdef ADC_SCAN_SEQ_FIXED
894
+ AdcChannelConf.Rank = ADC_RANK_CHANNEL_NUMBER; /* Enable the rank of the selected channels when not fully configurable */
895
+ #else
889
896
AdcChannelConf.Rank = ADC_REGULAR_RANK_1; /* Specifies the rank in the regular group sequencer */
897
+ #endif
890
898
#if !defined(STM32L0xx)
891
899
#if !defined(STM32G0xx)
892
900
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