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

Dependents:   mtsas mtsas mtsas mtsas

Files at this revision

API Documentation at this revision

Comitter:
Mike Fiore
Date:
Fri Jan 23 16:51:13 2015 -0600
Parent:
70:c0c621f88330
Child:
73:bba8669d36f7
Child:
74:d232ae44d136
Commit message:
use mts_min/mts_max inline functions instead of MIN/MAX macros - macros break in IAR

Changed in this revision

Cellular/EasyIP.cpp Show annotated file Show diff for this revision Revisions of this file
Cellular/UIP.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Cellular/EasyIP.cpp	Tue Nov 11 19:03:43 2014 +0000
+++ b/Cellular/EasyIP.cpp	Fri Jan 23 16:51:13 2015 -0600
@@ -466,7 +466,7 @@
         do {
             int available = io->writeable();
             if (available > 0) {
-                size = MIN(available, length - bytesWritten);
+                size = mts_min(available, length - bytesWritten);
                 bytesWritten += io->write(&data[bytesWritten], size);
             } else {
                 wait(0.05);
@@ -477,7 +477,7 @@
         do {
             int available = io->writeable();
             if(available > 0) {
-                size = MIN(available, length - bytesWritten);
+                size = mts_min(available, length - bytesWritten);
                 int currentWritten = io->write(&data[bytesWritten], size);
                 bytesWritten += currentWritten;
                 if(!currentWritten) {
--- a/Cellular/UIP.cpp	Tue Nov 11 19:03:43 2014 +0000
+++ b/Cellular/UIP.cpp	Fri Jan 23 16:51:13 2015 -0600
@@ -439,11 +439,11 @@
                     } else {
                         //We want to write all the way up to the next special character
                         int relativeIndex = vSpecial[specialWritten] - bytesWritten;
-                        int size = MIN(available, relativeIndex);
+                        int size = mts_min(available, relativeIndex);
                         bytesWritten += io->write(&data[bytesWritten], size);
                     }
                 } else {
-                    int size = MIN(available, length - bytesWritten);
+                    int size = mts_min(available, length - bytesWritten);
                     bytesWritten += io->write(&data[bytesWritten], size);
                 }
             } else {
@@ -535,4 +535,4 @@
         }
     }
     return false;
-}
\ No newline at end of file
+}