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.
Fork of MTS-Serial by
Diff: MTSBufferedIO.cpp
- Revision:
- 10:b18a1064dfc6
- Parent:
- 4:d348d001283b
- Child:
- 11:4afbbafcd6b3
--- a/MTSBufferedIO.cpp Mon Aug 11 15:44:14 2014 +0000
+++ b/MTSBufferedIO.cpp Fri Jan 23 16:52:25 2015 -0600
@@ -20,7 +20,7 @@
int bytesWritten = 0;
Timer tmr;
tmr.start();
- length = MAX(0,length);
+ length = mts_max(0,length);
do {
int bytesWrittenSwBuffer = txBuffer.write(&data[bytesWritten], length - bytesWritten);
if(bytesWrittenSwBuffer > 0) {
@@ -37,7 +37,7 @@
{
//Blocks until all bytes are written (different implementation planned once tx isr is working)
int bytesWritten = 0;
- length = MAX(0,length);
+ length = mts_max(0,length);
do {
int bytesWrittenSwBuffer = txBuffer.write(&data[bytesWritten], length - bytesWritten);
handleWrite();
@@ -67,7 +67,7 @@
int bytesRead = 0;
Timer tmr;
tmr.start();
- length = MAX(0,length);
+ length = mts_max(0,length);
do {
bytesRead += rxBuffer.read(&data[bytesRead], length - bytesRead);
} while(tmr.read_ms() <= timeoutMillis && bytesRead < length);
@@ -77,7 +77,7 @@
int MTSBufferedIO::read(char* data, int length)
{
int bytesRead = 0;
- length = MAX(0,length);
+ length = mts_max(0,length);
while(bytesRead < length) {
bytesRead += rxBuffer.read(&data[bytesRead], length - bytesRead);
}
