From e2f8d599567e19497a8f1fe144f6fcd96feefa65 Mon Sep 17 00:00:00 2001 From: DipSwitch Date: Sun, 6 Mar 2016 22:01:10 +0100 Subject: [PATCH] cpu/stm32f4/dma: Fix the IQRn calculation for DMA channels > 8 --- cpu/stm32f4/include/periph_cpu.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cpu/stm32f4/include/periph_cpu.h b/cpu/stm32f4/include/periph_cpu.h index eb3bab81b4..70f404cec4 100644 --- a/cpu/stm32f4/include/periph_cpu.h +++ b/cpu/stm32f4/include/periph_cpu.h @@ -184,14 +184,14 @@ static inline void dma_isr_enable(int stream) if (stream < 7) { NVIC_EnableIRQ((IRQn_Type)((int)DMA1_Stream0_IRQn + stream)); } - else if (stream == 8) { + else if (stream == 7) { NVIC_EnableIRQ(DMA1_Stream7_IRQn); } - else if (stream < 14) { - NVIC_EnableIRQ((IRQn_Type)((int)DMA2_Stream0_IRQn + stream)); + else if (stream < 13) { + NVIC_EnableIRQ((IRQn_Type)((int)DMA2_Stream0_IRQn + (stream - 8))); } - else if (stream < 17) { - NVIC_EnableIRQ((IRQn_Type)((int)DMA2_Stream5_IRQn + stream)); + else if (stream < 16) { + NVIC_EnableIRQ((IRQn_Type)((int)DMA2_Stream5_IRQn + (stream - 13))); } }