From c3943f4ec2c1a9cb13b7a8e082df86092257eb04 Mon Sep 17 00:00:00 2001 From: Hydra Date: Thu, 17 Nov 2016 15:27:17 +0100 Subject: [PATCH] Allow ADC DMA stream to be specified. --- src/main/drivers/adc_stm32f4xx.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/drivers/adc_stm32f4xx.c b/src/main/drivers/adc_stm32f4xx.c index f79e1954e..36ee525bd 100644 --- a/src/main/drivers/adc_stm32f4xx.c +++ b/src/main/drivers/adc_stm32f4xx.c @@ -37,8 +37,12 @@ #define ADC_INSTANCE ADC1 #endif +#ifndef ADC1_DMA_STREAM +#define ADC1_DMA_STREAM DMA2_Stream4 +#endif + const adcDevice_t adcHardware[] = { - { .ADCx = ADC1, .rccADC = RCC_APB2(ADC1), .DMAy_Streamx = DMA2_Stream4, .channel = DMA_Channel_0 }, + { .ADCx = ADC1, .rccADC = RCC_APB2(ADC1), .DMAy_Streamx = ADC1_DMA_STREAM, .channel = DMA_Channel_0 }, //{ .ADCx = ADC2, .rccADC = RCC_APB2(ADC2), .DMAy_Streamx = DMA2_Stream1, .channel = DMA_Channel_0 } };