mbed.org local branch of microbit-dal. The real version lives in git at https://github.com/lancaster-university/microbit-dal

Dependencies:   BLE_API nRF51822 mbed-dev-bin

Dependents:   microbit Microbit IoTChallenge1 microbit ... more

Revision:
46:c5bb7af0a3f0
Parent:
25:27299423d813
Child:
59:d73a257e9f89
--- a/source/drivers/MicroBitSerial.cpp	Wed Jul 13 12:18:24 2016 +0100
+++ b/source/drivers/MicroBitSerial.cpp	Wed Jul 13 12:18:25 2016 +0100
@@ -489,9 +489,17 @@
             return result;
     }
 
-    int bytesWritten = setTxInterrupt(buffer, bufferLen, mode);
+    bool complete = false;
+    int bytesWritten = 0;
 
-    send(mode);
+    while(!complete)
+    {
+        bytesWritten += setTxInterrupt(buffer + bytesWritten, bufferLen - bytesWritten, mode);
+        send(mode);
+
+        if(mode == ASYNC || bytesWritten >= bufferLen)
+            complete = true;
+    }
 
     unlockTx();