From 155b0d13536dabeb0eb2f8928e0d2b55640a17cc Mon Sep 17 00:00:00 2001 From: gdisirio Date: Tue, 14 May 2013 08:51:03 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@5735 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/SPC5xx/LINFlex_v1/serial_lld.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/os/hal/platforms/SPC5xx/LINFlex_v1/serial_lld.c b/os/hal/platforms/SPC5xx/LINFlex_v1/serial_lld.c index 9907e7a66..b31bd2387 100644 --- a/os/hal/platforms/SPC5xx/LINFlex_v1/serial_lld.c +++ b/os/hal/platforms/SPC5xx/LINFlex_v1/serial_lld.c @@ -142,15 +142,14 @@ static void spc5xx_serve_rxi_interrupt(SerialDriver *sdp) { sts |= SD_NOISE_ERROR; if (sr & SPC5_UARTSR_PE0) sts |= SD_PARITY_ERROR; - if (sts) { - chSysLockFromIsr(); + chSysLockFromIsr(); + if (sts) chnAddFlagsI(sdp, sts); - chSysUnlockFromIsr(); - } if (sr & SPC5_UARTSR_DRF) { - sdIncomingDataI(sdp, sdp->linflexp->BDRM.B.DATA4); - sdp->linflexp->UARTSR.R = SPC5_UARTSR_RMB; + sdIncomingDataI(sdp, sdp->linflexp->BDRM.B.DATA4); + sdp->linflexp->UARTSR.R = SPC5_UARTSR_RMB; } + chSysUnlockFromIsr(); } /** @@ -162,6 +161,7 @@ static void spc5xx_serve_txi_interrupt(SerialDriver *sdp) { msg_t b; sdp->linflexp->UARTSR.R = SPC5_UARTSR_DTF; + chSysLockFromIsr(); b = chOQGetI(&sdp->oqueue); if (b < Q_OK) { chnAddFlagsI(sdp, CHN_OUTPUT_EMPTY); @@ -169,6 +169,7 @@ static void spc5xx_serve_txi_interrupt(SerialDriver *sdp) { } else sdp->linflexp->BDRL.B.DATA0 = b; + chSysUnlockFromIsr(); } /**