Bayley Wang / Mbed 2 deprecated foc-ed_in_the_bot_compact

Dependencies:   FastPWM3 mbed

Files at this revision

API Documentation at this revision

Comitter:
bwang
Date:
Sun Apr 29 03:16:14 2018 +0000
Parent:
211:3193c31cb1b7
Child:
213:2218bab57355
Commit message:
backspace (ASCII 0x08, PuTTY Shift+Backspace) also deletes the previous char in the terminal

Changed in this revision

callbacks.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/callbacks.cpp	Sat Apr 28 21:33:05 2018 +0000
+++ b/callbacks.cpp	Sun Apr 29 03:16:14 2018 +0000
@@ -11,14 +11,15 @@
 void rxCallback() {
     while (io.pc->readable()) {
         char c = io.pc->getc();
-        if (c != 127 && c != '\r' && c != '\t') {
+        if (c != 127 && c != 8 && c != '\r' && c != '\t') {
             linebuf[index] = c;
             index++;
             io.pc->putc(c);
-        } else if (c == 127) {
+        } else if (c == 127 || c == 8) {
             if (index > 0) {
                 index--;
-                io.pc->putc(c);
+                //BS (8) should delete previous char
+                io.pc->putc(127);
             }
         } else if (c == '\r') {
             linebuf[index] = 0;
--- a/main.cpp	Sat Apr 28 21:33:05 2018 +0000
+++ b/main.cpp	Sun Apr 29 03:16:14 2018 +0000
@@ -173,7 +173,7 @@
 }
 
 int main() {    
-    dq = new DirectMapper(50.0f, 0.0f);//InterpolatingLutMapper();
+    dq = new DirectMapper(0.0f, 50.0f);//InterpolatingLutMapper();
     th = new LimitingThrottleMapper(1500.0f);
 
     BREMSInit(&io, &read, &foc, &control, false);