Quicksand micro-electronics / Mbed 2 deprecated HelloWorld - QW Development kit

Dependencies:   mbed QW_Sensors

Files at this revision

API Documentation at this revision

Comitter:
quicksand
Date:
Tue Mar 14 15:20:26 2017 +0000
Parent:
5:ca670603d63d
Commit message:
Code cleanup.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ca670603d63d -r ac11cebb397e main.cpp
--- a/main.cpp	Tue Mar 14 15:08:58 2017 +0000
+++ b/main.cpp	Tue Mar 14 15:20:26 2017 +0000
@@ -157,9 +157,9 @@
     /* Wait untill serial feedback, max 10 seconds before timeout */
     tmout.attach(&sertmout, 10.0);
     int c;
-    while(!ser_timeout && !ok && !error)
-        while (modem.readable() && !ser_timeout  && !ok && !error) {
-        c = modem.getc();
+    while (!ser_timeout  && !ok && !error) {
+        if(modem.readable()) {
+            c = modem.getc();
             if ( (char)c == *readyStringPtr ) readyStringPtr++;
             else readyStringPtr = readyString;
             if ( *readyStringPtr == 0 ) {
@@ -171,7 +171,8 @@
                 error = true;
             }
         }
+    }
     tmout.detach();
     if(ser_timeout) return false;
     else return ok;
-    }
\ No newline at end of file
+}
\ No newline at end of file