Interactive serial interface for sending commands to an embedded system using serial communications. This will be helpful if you want to send commands to serial port and be able to correct the wrong text entered at the terminal

Dependencies:   mbed

Revision:
3:12840abcee40
Parent:
2:880559109781
Child:
4:183056edc0f4
diff -r 880559109781 -r 12840abcee40 main.cpp
--- a/main.cpp	Wed Sep 20 05:38:55 2017 +0000
+++ b/main.cpp	Wed Sep 20 05:45:34 2017 +0000
@@ -20,7 +20,8 @@
         stringBuf[i]=pc.getc();
         if(stringBuf[i]=='\n') {
             stringBuf[i]='\0';
-            i--;
+             if (i>0){
+               i--;
             if(stringBuf[i]=='\r') {
                         stringBuf[i]='\0';
             }