aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2017-07-02 06:40:46 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2017-07-02 06:40:46 +0000
commitc6d3697eda985c4ecbd0021ae0c20e5194436c9f (patch)
tree6f29f006b70232cc9d9555f0962432a1013e29c7 /os/hal/ports/STM32
parentf3c59270de92e7424bcdd5a8966e026dc6689008 (diff)
downloadChibiOS-c6d3697eda985c4ecbd0021ae0c20e5194436c9f.tar.gz
ChibiOS-c6d3697eda985c4ecbd0021ae0c20e5194436c9f.tar.bz2
ChibiOS-c6d3697eda985c4ecbd0021ae0c20e5194436c9f.zip
Fixed bug #851.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10284 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32')
-rw-r--r--os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
index 5bf3b6089..54378ff06 100644
--- a/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv2/hal_uart_lld.c
@@ -127,6 +127,11 @@
#define UART8 USART8
#endif
+/* Workaround for more differences in headers.*/
+#if !defined(USART_CR1_M0)
+#define USART_CR1_M0 USART_CR1_M
+#endif
+
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
@@ -845,7 +850,7 @@ void uart_lld_start(UARTDriver *uartp) {
/* Static DMA setup, the transfer size depends on the USART settings,
it is 16 bits if M=1 and PCE=0 else it is 8 bits.*/
- if ((uartp->config->cr1 & (USART_CR1_M | USART_CR1_PCE)) == USART_CR1_M)
+ if ((uartp->config->cr1 & (USART_CR1_M | USART_CR1_PCE)) == USART_CR1_M0)
uartp->dmamode |= STM32_DMA_CR_PSIZE_HWORD | STM32_DMA_CR_MSIZE_HWORD;
dmaStreamSetPeripheral(uartp->dmarx, &uartp->usart->RDR);
dmaStreamSetPeripheral(uartp->dmatx, &uartp->usart->TDR);