diff --git a/src/main/drivers/adc_stm32f30x.c b/src/main/drivers/adc_stm32f30x.c index 81eb6e6c4..e6f536c0a 100644 --- a/src/main/drivers/adc_stm32f30x.c +++ b/src/main/drivers/adc_stm32f30x.c @@ -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); diff --git a/src/main/drivers/adc_stm32f4xx.c b/src/main/drivers/adc_stm32f4xx.c index c247384f5..f3340f448 100644 --- a/src/main/drivers/adc_stm32f4xx.c +++ b/src/main/drivers/adc_stm32f4xx.c @@ -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]; diff --git a/src/main/drivers/adc_stm32f7xx.c b/src/main/drivers/adc_stm32f7xx.c index 83dc3e573..255e61061 100644 --- a/src/main/drivers/adc_stm32f7xx.c +++ b/src/main/drivers/adc_stm32f7xx.c @@ -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];