aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src/hal_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/src/hal_uart.c')
-rw-r--r--os/hal/src/hal_uart.c4
1 files changed, 2 insertions, 2 deletions
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();