Merge pull request #1301 from Pierre-A/adcRssi-correction
Fix incorrect DMA index for RSSI and External (F1 proc)
This commit is contained in:
commit
a47b8f0d58
|
@ -73,17 +73,6 @@ void adcInit(drv_adc_config_t *init)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTERNAL1_ADC_GPIO
|
|
||||||
if (init->enableExternal1) {
|
|
||||||
GPIO_InitStructure.GPIO_Pin = EXTERNAL1_ADC_GPIO_PIN;
|
|
||||||
GPIO_Init(EXTERNAL1_ADC_GPIO, &GPIO_InitStructure);
|
|
||||||
adcConfig[ADC_EXTERNAL1].adcChannel = EXTERNAL1_ADC_CHANNEL;
|
|
||||||
adcConfig[ADC_EXTERNAL1].dmaIndex = configuredAdcChannels++;
|
|
||||||
adcConfig[ADC_EXTERNAL1].enabled = true;
|
|
||||||
adcConfig[ADC_EXTERNAL1].sampleTime = ADC_SampleTime_239Cycles5;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RSSI_ADC_GPIO
|
#ifdef RSSI_ADC_GPIO
|
||||||
if (init->enableRSSI) {
|
if (init->enableRSSI) {
|
||||||
GPIO_InitStructure.GPIO_Pin = RSSI_ADC_GPIO_PIN;
|
GPIO_InitStructure.GPIO_Pin = RSSI_ADC_GPIO_PIN;
|
||||||
|
@ -95,6 +84,17 @@ void adcInit(drv_adc_config_t *init)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef EXTERNAL1_ADC_GPIO
|
||||||
|
if (init->enableExternal1) {
|
||||||
|
GPIO_InitStructure.GPIO_Pin = EXTERNAL1_ADC_GPIO_PIN;
|
||||||
|
GPIO_Init(EXTERNAL1_ADC_GPIO, &GPIO_InitStructure);
|
||||||
|
adcConfig[ADC_EXTERNAL1].adcChannel = EXTERNAL1_ADC_CHANNEL;
|
||||||
|
adcConfig[ADC_EXTERNAL1].dmaIndex = configuredAdcChannels++;
|
||||||
|
adcConfig[ADC_EXTERNAL1].enabled = true;
|
||||||
|
adcConfig[ADC_EXTERNAL1].sampleTime = ADC_SampleTime_239Cycles5;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CURRENT_METER_ADC_GPIO
|
#ifdef CURRENT_METER_ADC_GPIO
|
||||||
if (init->enableCurrentMeter) {
|
if (init->enableCurrentMeter) {
|
||||||
GPIO_InitStructure.GPIO_Pin = CURRENT_METER_ADC_GPIO_PIN;
|
GPIO_InitStructure.GPIO_Pin = CURRENT_METER_ADC_GPIO_PIN;
|
||||||
|
|
Loading…
Reference in New Issue