From f3557b8d6087d6e041c781419cda694431916fc4 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Thu, 8 Nov 2012 12:13:16 -0500 Subject: stm32f4/dma: Fix DMA_ISR_OFFSET definition --- include/libopencm3/stm32/f4/dma.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/libopencm3/stm32/f4') diff --git a/include/libopencm3/stm32/f4/dma.h b/include/libopencm3/stm32/f4/dma.h index 1f034fa..c765a79 100644 --- a/include/libopencm3/stm32/f4/dma.h +++ b/include/libopencm3/stm32/f4/dma.h @@ -233,7 +233,7 @@ LGPL License Terms @ref lgpl_license /**@}*/ /* Offset within interrupt status register to start of stream interrupt flag field */ -#define DMA_ISR_OFFSET(stream) (6*(stream & 0x01)+16*(stream & 0x02)) +#define DMA_ISR_OFFSET(stream) (6*(stream & 0x01)+16*((stream & 0x02) >> 1)) #define DMA_ISR_FLAGS (DMA_ISR_TCIF | DMA_ISR_HTIF | DMA_ISR_TEIF | DMA_ISR_DMEIF | DMA_ISR_FEIF) #define DMA_ISR_MASK(stream) DMA_ISR_FLAGS << DMA_ISR_OFFSET(stream) -- cgit v1.2.3