From 5925c748395e1d01cf4c505497fdd2eeb67133d5 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 2 Jan 2014 10:26:23 +0000 Subject: [PATCH] Again bug #442. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6589 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/USARTv1/serial_lld.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/os/hal/platforms/STM32/USARTv1/serial_lld.c b/os/hal/platforms/STM32/USARTv1/serial_lld.c index 9a9596424..eb344ebc0 100644 --- a/os/hal/platforms/STM32/USARTv1/serial_lld.c +++ b/os/hal/platforms/STM32/USARTv1/serial_lld.c @@ -161,7 +161,7 @@ static void serve_interrupt(SerialDriver *sdp) { chSysLockFromIsr(); chnAddFlagsI(sdp, SD_BREAK_DETECTED); chSysUnlockFromIsr(); - u->SR &= ~USART_SR_LBD; + u->SR = ~USART_SR_LBD; } /* Data available.*/ @@ -194,8 +194,8 @@ static void serve_interrupt(SerialDriver *sdp) { chSysLockFromIsr(); chnAddFlagsI(sdp, CHN_TRANSMISSION_END); chSysUnlockFromIsr(); - u->CR1 = cr1 & ~USART_CR1_TCIE; - u->SR &= ~USART_SR_TC; + u->CR1 = cr1 & ~(USART_CR1_TXEIE | USART_CR1_TCIE); + u->SR = ~USART_SR_TC; } }