mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-17 05:15:25 +03:00
parent
8fcffa1454
commit
3b77626dd8
5 changed files with 21 additions and 17 deletions
|
@ -52,14 +52,16 @@ void adcInit(drv_adc_config_t *init)
|
|||
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ;
|
||||
|
||||
#ifdef VBAT_ADC_GPIO
|
||||
GPIO_InitStructure.GPIO_Pin = VBAT_ADC_GPIO_PIN;
|
||||
GPIO_Init(VBAT_ADC_GPIO, &GPIO_InitStructure);
|
||||
if (init->enableVBat) {
|
||||
GPIO_InitStructure.GPIO_Pin = VBAT_ADC_GPIO_PIN;
|
||||
GPIO_Init(VBAT_ADC_GPIO, &GPIO_InitStructure);
|
||||
|
||||
adcConfig[ADC_BATTERY].adcChannel = VBAT_ADC_CHANNEL;
|
||||
adcConfig[ADC_BATTERY].dmaIndex = adcChannelCount;
|
||||
adcConfig[ADC_BATTERY].sampleTime = ADC_SampleTime_601Cycles5;
|
||||
adcConfig[ADC_BATTERY].enabled = true;
|
||||
adcChannelCount++;
|
||||
adcConfig[ADC_BATTERY].adcChannel = VBAT_ADC_CHANNEL;
|
||||
adcConfig[ADC_BATTERY].dmaIndex = adcChannelCount;
|
||||
adcConfig[ADC_BATTERY].sampleTime = ADC_SampleTime_601Cycles5;
|
||||
adcConfig[ADC_BATTERY].enabled = true;
|
||||
adcChannelCount++;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CURRENT_METER_ADC_GPIO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue