From 8e46b4fa82691642af24ca583efe2fc40013a347 Mon Sep 17 00:00:00 2001 From: jflyper Date: Sun, 30 Dec 2018 23:45:52 +0900 Subject: [PATCH] Channel spec should be DMA_Channel_x. --- src/main/drivers/dma_reqmap.c | 7 ++++++- src/main/drivers/dma_reqmap.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/drivers/dma_reqmap.c b/src/main/drivers/dma_reqmap.c index 77f8784537b..83434092841 100644 --- a/src/main/drivers/dma_reqmap.c +++ b/src/main/drivers/dma_reqmap.c @@ -38,7 +38,12 @@ typedef struct dmaRequestMapping_s { } dmaRequestMapping_t; #if defined(STM32F4) || defined(STM32F7) -#define D(d, s, c) { DMA_CODE(d, s, c), DMA ## d ## _Stream ## s, c } + +#if defined(STM32F4) +#define D(d, s, c) { DMA_CODE(d, s, c), DMA ## d ## _Stream ## s, DMA_Channel_ ## c } +#elif defined(STM32F7) +#define D(d, s, c) { DMA_CODE(d, s, c), DMA ## d ## _Stream ## s, DMA_CHANNEL_ ## c } +#endif static const dmaRequestMapping_t dmaRequestMapping[] = { #ifdef USE_SPI diff --git a/src/main/drivers/dma_reqmap.h b/src/main/drivers/dma_reqmap.h index c31c6d1e4ac..883c609533c 100644 --- a/src/main/drivers/dma_reqmap.h +++ b/src/main/drivers/dma_reqmap.h @@ -28,7 +28,7 @@ typedef struct dmaChannelSpec_s { dmaCode_t code; #if defined(STM32F4) || defined(STM32F7) DMA_Stream_TypeDef *ref; - uint8_t channel; + uint32_t channel; #else DMA_Channel_TypeDef *ref; #endif