mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-16 21:05:35 +03:00
Merge pull request #4934 from jflyper/_bfdev-adc-internal-followup-to-2926
Internal ADC Enable scan conversion on main ADC even for channelCount = 1 case
This commit is contained in:
commit
ba526e323f
1 changed files with 7 additions and 1 deletions
|
@ -114,8 +114,14 @@ void adcInitDevice(ADC_TypeDef *adcdev, int channelCount)
|
|||
ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None;
|
||||
ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
|
||||
ADC_InitStructure.ADC_NbrOfConversion = channelCount;
|
||||
ADC_InitStructure.ADC_ScanConvMode = channelCount > 1 ? ENABLE : DISABLE; // 1=scan more that one channel in group
|
||||
|
||||
// Multiple injected channel seems to require scan conversion mode to be
|
||||
// enabled even if main (non-injected) channel count is 1.
|
||||
#ifdef USE_ADC_INTERNAL
|
||||
ADC_InitStructure.ADC_ScanConvMode = ENABLE;
|
||||
#else
|
||||
ADC_InitStructure.ADC_ScanConvMode = channelCount > 1 ? ENABLE : DISABLE; // 1=scan more that one channel in group
|
||||
#endif
|
||||
ADC_Init(adcdev, &ADC_InitStructure);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue