1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-16 12:55:19 +03:00

Merge pull request #6843 from jflyper/bfdev-fix-f3-adc-device-origin

F3: Use ADC device from PG
This commit is contained in:
Michael Keller 2018-10-01 22:02:34 +13:00 committed by GitHub
commit 1ab3d75b4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View file

@ -118,9 +118,10 @@ void adcInit(const adcConfig_t *config)
adcOperatingConfig[ADC_CURRENT].tag = config->current.ioTag; //CURRENT_METER_ADC_CHANNEL;
}
ADCDevice device = adcDeviceByInstance(ADC_INSTANCE);
if (device == ADCINVALID)
ADCDevice device = ADC_CFG_TO_DEV(config->device);
if (device == ADCINVALID) {
return;
}
#ifdef ADC24_DMA_REMAP
SYSCFG_DMAChannelRemapConfig(SYSCFG_DMARemap_ADC2ADC4, ENABLE);

View file

@ -211,8 +211,9 @@ void adcInit(const adcConfig_t *config)
}
ADCDevice device = ADC_CFG_TO_DEV(config->device);
if (device == ADCINVALID)
if (device == ADCINVALID) {
return;
}
adcDevice_t adc = adcHardware[device];

View file

@ -237,8 +237,9 @@ void adcInit(const adcConfig_t *config)
}
ADCDevice device = adcDeviceByInstance(ADC_INSTANCE);
if (device == ADCINVALID)
if (device == ADCINVALID) {
return;
}
adc = adcHardware[device];