From 9fa7ba7b562aadfc9735c03d239375596a2d7233 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Tue, 5 Sep 2017 12:12:31 +0000 Subject: Fixed bug #883. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10558 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/src/hal_uart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'os/hal/src/hal_uart.c') diff --git a/os/hal/src/hal_uart.c b/os/hal/src/hal_uart.c index 8df77adb5..89276f28f 100644 --- a/os/hal/src/hal_uart.c +++ b/os/hal/src/hal_uart.c @@ -384,7 +384,7 @@ msg_t uartSendTimeout(UARTDriver *uartp, size_t *np, /* Waiting for result.*/ msg = osalThreadSuspendTimeoutS(&uartp->threadtx, timeout); if (msg != MSG_OK) { - *np = uartStopSendI(uartp); + *np -= uartStopSendI(uartp); } osalSysUnlock(); @@ -475,7 +475,7 @@ msg_t uartReceiveTimeout(UARTDriver *uartp, size_t *np, /* Waiting for result.*/ msg = osalThreadSuspendTimeoutS(&uartp->threadrx, timeout); if (msg != MSG_OK) { - *np = uartStopReceiveI(uartp); + *np -= uartStopReceiveI(uartp); } osalSysUnlock(); -- cgit v1.2.3