diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-08 13:41:46 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2015-12-08 13:41:46 +0000 |
commit | baf8b1a40e60ef34159eaa5e52cbbb72a41fb103 (patch) | |
tree | 37aa871c67b904fa59707227c8ebac1536ed840b /os/hal/ports/STM32 | |
parent | 9210ae4da0ebf07120028faf2473b1a11d84863c (diff) | |
download | ChibiOS-baf8b1a40e60ef34159eaa5e52cbbb72a41fb103.tar.gz ChibiOS-baf8b1a40e60ef34159eaa5e52cbbb72a41fb103.tar.bz2 ChibiOS-baf8b1a40e60ef34159eaa5e52cbbb72a41fb103.zip |
Fixed buf #678.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8569 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r-- | os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c | 10 | ||||
-rw-r--r-- | os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h | 4 |
2 files changed, 12 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c index 2376ab18c..9ad198e24 100644 --- a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c +++ b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c @@ -127,6 +127,14 @@ #define DMA2_CH5_CMASK 0x00000800U
#endif
+#if !defined(DMA2_CH6_CMASK)
+#define DMA2_CH6_CMASK 0x00001000U
+#endif
+
+#if !defined(DMA2_CH7_CMASK)
+#define DMA2_CH7_CMASK 0x00002000U
+#endif
+
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -157,7 +165,7 @@ const stm32_dma_stream_t _stm32_dma_streams[STM32_DMA_STREAMS] = { #if STM32_DMA2_NUM_CHANNELS > 5
{DMA2, DMA2_Channel6, DMA2_CH6_CMASK, ADDR_DMA2_CSELR, 20, 12, STM32_DMA2_CH6_NUMBER},
#if STM32_DMA2_NUM_CHANNELS > 6
- {DMA2, DMA2_Channel6, DMA2_CH7_CMASK, ADDR_DMA2_CSELR, 24, 13, STM32_DMA2_CH7_NUMBER},
+ {DMA2, DMA2_Channel7, DMA2_CH7_CMASK, ADDR_DMA2_CSELR, 24, 13, STM32_DMA2_CH7_NUMBER},
#endif
#endif
#endif
diff --git a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h index 72eb34f58..399112cd8 100644 --- a/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h +++ b/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.h @@ -58,7 +58,7 @@ * nibble
* @return Returns the request associated to the stream.
*/
-#define STM32_DMA_GETCHANNEL(id, c) (((c) >> (((id) & 7U) * 4U)) & 15U)
+#define STM32_DMA_GETCHANNEL(id, c) (((c) >> (((id) % 7U) * 4U)) & 15U)
/**
* @brief Checks if a DMA priority is within the valid range.
@@ -127,6 +127,8 @@ #define STM32_DMA2_STREAM3 STM32_DMA_STREAM(9)
#define STM32_DMA2_STREAM4 STM32_DMA_STREAM(10)
#define STM32_DMA2_STREAM5 STM32_DMA_STREAM(11)
+#define STM32_DMA2_STREAM6 STM32_DMA_STREAM(12)
+#define STM32_DMA2_STREAM7 STM32_DMA_STREAM(13)
/** @} */
/**
|