aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/stm32/f4/dma.h
diff options
context:
space:
mode:
authorBen Gamari2012-11-08 12:13:16 -0500
committerBen Gamari2012-11-08 12:13:16 -0500
commitf3557b8d6087d6e041c781419cda694431916fc4 (patch)
treeb2f66d1b9ba71dc58994eef6604f6f30f1a14dd3 /include/libopencm3/stm32/f4/dma.h
parent2fe567e25debd0cb6ac7a92f229055679125bcdb (diff)
stm32f4/dma: Fix DMA_ISR_OFFSET definition
Diffstat (limited to 'include/libopencm3/stm32/f4/dma.h')
-rw-r--r--include/libopencm3/stm32/f4/dma.h2
1 files changed, 1 insertions, 1 deletions
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)