Add to 11U68 11E68

Dependencies:   DirectoryList MODSERIAL mbed

Fork of ika_shouyu_poppoyaki by Tedd OKANO

Revision:
9:ca4c9a2ac8e1
Parent:
8:b220fadbb3d8
Child:
10:90bd46dadeb4
--- a/main.cpp	Sun Aug 25 06:22:33 2013 +0000
+++ b/main.cpp	Sun Aug 25 06:33:14 2013 +0000
@@ -400,10 +400,23 @@
 }
 
 
+Timeout timeout;
+
+int timeout_flag    = 0;
+
+void set_flag()
+{
+    timeout_flag    = 1;
+}
+
+
 void get_string( char *s )
 {
     int     i   = 0;
     char    c   = 0;
+    timeout_flag    = 0;
+
+    timeout.attach( &set_flag, 1 );
 
     do {
         do {
@@ -416,8 +429,13 @@
                 *s++    = c;
                 i++;
             }
+
+            if ( timeout_flag )
+                return;
         } while ( 1 );
     } while ( !i );
 
     *s  = '\0';
 }
+
+