mbed

Fork of mbed-dev by mbed official

Revision:
162:e13f6fdb2ac4
Parent:
150:02e0a0aed4ec
Child:
165:e614a9f1c9e2
diff -r 2cc1468da177 -r e13f6fdb2ac4 targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c
--- a/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c	Thu Mar 30 13:45:57 2017 +0100
+++ b/targets/TARGET_NORDIC/TARGET_NRF5/serial_api.c	Wed Apr 12 16:21:43 2017 +0100
@@ -199,12 +199,13 @@
 
     #if DEVICE_SERIAL_ASYNCH
         if (UART_CB.tx_active) {
-            if (++UART_CB.tx_pos <= UART_CB.tx_length) {
+            if (UART_CB.tx_pos < UART_CB.tx_length) {
                 // When there is still something to send, clear the TXDRDY event
                 // and put next byte to transmitter.
                 nrf_uart_event_clear(UART_INSTANCE, NRF_UART_EVENT_TXDRDY);
                 nrf_uart_txd_set(UART_INSTANCE,
                     UART_CB.tx_buffer[UART_CB.tx_pos]);
+                UART_CB.tx_pos++;
             }
             else {
                 // When the TXDRDY event is set after the last byte to be sent