Browse Source

Add G-code "backspace" support

Scott Lahteine 5 years ago
parent
commit
ca5a8ea827
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      Marlin/src/gcode/queue.cpp

+ 9
- 3
Marlin/src/gcode/queue.cpp View File

387
     }
387
     }
388
   #endif
388
   #endif
389
 
389
 
390
-  buff[ind++] = c;
391
-  if (ind >= MAX_CMD_SIZE - 1)
392
-    sis = PS_EOL;               // Skip the rest on overflow
390
+  // Backspace erases previous characters
391
+  if (c == 0x08) {
392
+    if (ind) buff[--ind] = '\0';
393
+  }
394
+  else {
395
+    buff[ind++] = c;
396
+    if (ind >= MAX_CMD_SIZE - 1)
397
+      sis = PS_EOL;             // Skip the rest on overflow
398
+  }
393
 }
399
 }
394
 
400
 
395
 /**
401
 /**

Loading…
Cancel
Save