Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BLE_API mbed-dev-bin nRF51822
Fork of microbit-dal by
Diff: source/drivers/MicroBitSerial.cpp
- 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();
