diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-16 09:27:19 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2012-12-16 09:27:19 +0000 |
commit | aaac1b2e53af4dcee1278c2de6e90ce952a5f904 (patch) | |
tree | 20b10627a52e3341a36c02154f4849e757b59d2d /os/hal | |
parent | ca21f0fa25e633f5fa42a04058d1e39b410ffffe (diff) | |
download | ChibiOS-aaac1b2e53af4dcee1278c2de6e90ce952a5f904.tar.gz ChibiOS-aaac1b2e53af4dcee1278c2de6e90ce952a5f904.tar.bz2 ChibiOS-aaac1b2e53af4dcee1278c2de6e90ce952a5f904.zip |
Fixed bug 3592764.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4916 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r-- | os/hal/platforms/STM32/USARTv1/uart_lld.c | 5 | ||||
-rw-r--r-- | os/hal/platforms/STM32/USARTv2/uart_lld.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/os/hal/platforms/STM32/USARTv1/uart_lld.c b/os/hal/platforms/STM32/USARTv1/uart_lld.c index d09f96c93..496fb0e13 100644 --- a/os/hal/platforms/STM32/USARTv1/uart_lld.c +++ b/os/hal/platforms/STM32/USARTv1/uart_lld.c @@ -395,6 +395,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART1
uartObjectInit(&UARTD1);
UARTD1.usart = USART1;
+ UARTD1.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD1.dmarx = STM32_DMA_STREAM(STM32_UART_USART1_RX_DMA_STREAM);
UARTD1.dmatx = STM32_DMA_STREAM(STM32_UART_USART1_TX_DMA_STREAM);
#endif
@@ -402,6 +403,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART2
uartObjectInit(&UARTD2);
UARTD2.usart = USART2;
+ UARTD2.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD2.dmarx = STM32_DMA_STREAM(STM32_UART_USART2_RX_DMA_STREAM);
UARTD2.dmatx = STM32_DMA_STREAM(STM32_UART_USART2_TX_DMA_STREAM);
#endif
@@ -409,6 +411,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART3
uartObjectInit(&UARTD3);
UARTD3.usart = USART3;
+ UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD3.dmarx = STM32_DMA_STREAM(STM32_UART_USART3_RX_DMA_STREAM);
UARTD3.dmatx = STM32_DMA_STREAM(STM32_UART_USART3_TX_DMA_STREAM);
#endif
@@ -430,8 +433,6 @@ void uart_lld_init(void) { */
void uart_lld_start(UARTDriver *uartp) {
- uartp->dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
-
if (uartp->state == UART_STOP) {
#if STM32_UART_USE_USART1
if (&UARTD1 == uartp) {
diff --git a/os/hal/platforms/STM32/USARTv2/uart_lld.c b/os/hal/platforms/STM32/USARTv2/uart_lld.c index 378f93348..bcb399496 100644 --- a/os/hal/platforms/STM32/USARTv2/uart_lld.c +++ b/os/hal/platforms/STM32/USARTv2/uart_lld.c @@ -362,6 +362,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART1
uartObjectInit(&UARTD1);
UARTD1.usart = USART1;
+ UARTD1.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD1.dmarx = STM32_DMA_STREAM(STM32_UART_USART1_RX_DMA_STREAM);
UARTD1.dmatx = STM32_DMA_STREAM(STM32_UART_USART1_TX_DMA_STREAM);
#endif
@@ -369,6 +370,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART2
uartObjectInit(&UARTD2);
UARTD2.usart = USART2;
+ UARTD2.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD2.dmarx = STM32_DMA_STREAM(STM32_UART_USART2_RX_DMA_STREAM);
UARTD2.dmatx = STM32_DMA_STREAM(STM32_UART_USART2_TX_DMA_STREAM);
#endif
@@ -376,6 +378,7 @@ void uart_lld_init(void) { #if STM32_UART_USE_USART3
uartObjectInit(&UARTD3);
UARTD3.usart = USART3;
+ UARTD3.dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
UARTD3.dmarx = STM32_DMA_STREAM(STM32_UART_USART3_RX_DMA_STREAM);
UARTD3.dmatx = STM32_DMA_STREAM(STM32_UART_USART3_TX_DMA_STREAM);
#endif
@@ -390,8 +393,6 @@ void uart_lld_init(void) { */
void uart_lld_start(UARTDriver *uartp) {
- uartp->dmamode = STM32_DMA_CR_DMEIE | STM32_DMA_CR_TEIE;
-
if (uartp->state == UART_STOP) {
#if STM32_UART_USE_USART1
if (&UARTD1 == uartp) {
|