aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-01-08 21:20:41 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2012-01-08 21:20:41 +0000
commit4817e5d8143b362981684de9225bcc0805d2bb0d (patch)
tree4600c015fb7f36ab0d13628544cee87f7158364d /os
parent340385485a74f35e167ab2016bc8d57e7434bf27 (diff)
downloadChibiOS-4817e5d8143b362981684de9225bcc0805d2bb0d.tar.gz
ChibiOS-4817e5d8143b362981684de9225bcc0805d2bb0d.tar.bz2
ChibiOS-4817e5d8143b362981684de9225bcc0805d2bb0d.zip
DMA. Fixed possible overflow in DMA priority.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3772 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/platforms/STM32F1xx/stm32_dma.h2
-rw-r--r--os/hal/platforms/STM32F2xx/stm32_dma.h2
-rw-r--r--os/hal/platforms/STM32F4xx/stm32_dma.h2
-rw-r--r--os/hal/platforms/STM32L1xx/stm32_dma.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32F1xx/stm32_dma.h b/os/hal/platforms/STM32F1xx/stm32_dma.h
index 7e230d851..deaac593d 100644
--- a/os/hal/platforms/STM32F1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32F1xx/stm32_dma.h
@@ -146,7 +146,7 @@
#define STM32_DMA_CR_SIZE_MASK (STM32_DMA_CR_MSIZE_MASK | \
STM32_DMA_CR_MSIZE_MASK)
#define STM32_DMA_CR_PL_MASK DMA_CCR1_PL
-#define STM32_DMA_CR_PL(n) ((n) << 12)
+#define STM32_DMA_CR_PL(n) (((n) << 12) & (STM32_DMA_CR_PL_MASK))
/** @} */
/**
diff --git a/os/hal/platforms/STM32F2xx/stm32_dma.h b/os/hal/platforms/STM32F2xx/stm32_dma.h
index b5f95f0c8..d5cc2641c 100644
--- a/os/hal/platforms/STM32F2xx/stm32_dma.h
+++ b/os/hal/platforms/STM32F2xx/stm32_dma.h
@@ -144,7 +144,7 @@
#define STM32_DMA_CR_SIZE_MASK (STM32_DMA_CR_MSIZE_MASK | \
STM32_DMA_CR_MSIZE_MASK)
#define STM32_DMA_CR_PL_MASK DMA_SxCR_PL
-#define STM32_DMA_CR_PL(n) ((n) << 16)
+#define STM32_DMA_CR_PL(n) (((n) << 16) & (STM32_DMA_CR_PL_MASK))
/** @} */
/**
diff --git a/os/hal/platforms/STM32F4xx/stm32_dma.h b/os/hal/platforms/STM32F4xx/stm32_dma.h
index 16dcea02d..9879dcd24 100644
--- a/os/hal/platforms/STM32F4xx/stm32_dma.h
+++ b/os/hal/platforms/STM32F4xx/stm32_dma.h
@@ -144,7 +144,7 @@
#define STM32_DMA_CR_SIZE_MASK (STM32_DMA_CR_MSIZE_MASK | \
STM32_DMA_CR_MSIZE_MASK)
#define STM32_DMA_CR_PL_MASK DMA_SxCR_PL
-#define STM32_DMA_CR_PL(n) ((n) << 16)
+#define STM32_DMA_CR_PL(n) (((n) << 16) & (STM32_DMA_CR_PL_MASK))
/** @} */
/**
diff --git a/os/hal/platforms/STM32L1xx/stm32_dma.h b/os/hal/platforms/STM32L1xx/stm32_dma.h
index 6afadfcc1..7bc6362b0 100644
--- a/os/hal/platforms/STM32L1xx/stm32_dma.h
+++ b/os/hal/platforms/STM32L1xx/stm32_dma.h
@@ -137,7 +137,7 @@
#define STM32_DMA_CR_SIZE_MASK (STM32_DMA_CR_MSIZE_MASK | \
STM32_DMA_CR_MSIZE_MASK)
#define STM32_DMA_CR_PL_MASK DMA_CCR1_PL
-#define STM32_DMA_CR_PL(n) ((n) << 12)
+#define STM32_DMA_CR_PL(n) (((n) << 12) & (STM32_DMA_CR_PL_MASK))
/** @} */
/**