aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libopencm3/stm32/f4/dma.h2
-rw-r--r--lib/stm32/f4/Makefile2
-rw-r--r--lib/stm32/f4/dma.c2
3 files changed, 3 insertions, 3 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)
diff --git a/lib/stm32/f4/Makefile b/lib/stm32/f4/Makefile
index 9e62fea..09fe573 100644
--- a/lib/stm32/f4/Makefile
+++ b/lib/stm32/f4/Makefile
@@ -32,7 +32,7 @@ ARFLAGS = rcs
OBJS = rcc.o gpio2.o usart.o spi.o flash.o \
i2c.o exti2.o pwr.o timer.o \
usb.o usb_standard.o usb_control.o usb_fx07_common.o usb_f107.o \
- usb_f207.o adc.o
+ usb_f207.o adc.o dma.o
VPATH += ../../usb:../:../../cm3
diff --git a/lib/stm32/f4/dma.c b/lib/stm32/f4/dma.c
index 80eb963..7c80dcf 100644
--- a/lib/stm32/f4/dma.c
+++ b/lib/stm32/f4/dma.c
@@ -123,7 +123,7 @@ The interrupt flag for the stream is returned.
@param[in] dma unsigned int32. DMA controller base address: DMA1 or DMA2
@param[in] stream unsigned int8. Stream number: @ref dma_st_number
-@param[in] interrupt unsigned int32. Interrupt number: @ref dma_st_number
+@param[in] interrupt unsigned int32. Interrupt number: @ref dma_if_offset
@returns bool interrupt flag is set.
*/