aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-03-01 09:18:26 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-03-01 09:18:26 +0000
commite6c4363ddbad4d4bd1bbb79e46fcdc2cda396d0e (patch)
tree6222e67f8f717e8f4ba75697e82042c0ce467e08 /os/hal
parente068671a361fff569fdc386c762680032670737c (diff)
downloadChibiOS-e6c4363ddbad4d4bd1bbb79e46fcdc2cda396d0e.tar.gz
ChibiOS-e6c4363ddbad4d4bd1bbb79e46fcdc2cda396d0e.tar.bz2
ChibiOS-e6c4363ddbad4d4bd1bbb79e46fcdc2cda396d0e.zip
Fixed bug #558.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7706 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/ports/STM32/LLD/USARTv1/serial_lld.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/USARTv1/serial_lld.c b/os/hal/ports/STM32/LLD/USARTv1/serial_lld.c
index 45140b88c..69b725d10 100644
--- a/os/hal/ports/STM32/LLD/USARTv1/serial_lld.c
+++ b/os/hal/ports/STM32/LLD/USARTv1/serial_lld.c
@@ -165,11 +165,16 @@ static void serve_interrupt(SerialDriver *sdp) {
/* Data available.*/
osalSysLockFromISR();
- while (sr & USART_SR_RXNE) {
+ while (sr & (USART_SR_RXNE | USART_SR_ORE | USART_SR_NE | USART_SR_FE |
+ USART_SR_PE)) {
+ uint8_t b;
+
/* Error condition detection.*/
if (sr & (USART_SR_ORE | USART_SR_NE | USART_SR_FE | USART_SR_PE))
set_error(sdp, sr);
- sdIncomingDataI(sdp, u->DR);
+ b = u->DR;
+ if (sr & USART_SR_RXNE)
+ sdIncomingDataI(sdp, b);
sr = u->SR;
}
osalSysUnlockFromISR();