Serial library for MTS Socket Modem Arduino Shield devices from Multi-Tech Systems

Dependents:   mDot_AT_firmware mtsas mtsas MTDOT-EVB-LinkCheck-AL ... more

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);
     }