Browse Source

Add G-code "backspace" support

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
ca5a8ea827
  1. 12
      Marlin/src/gcode/queue.cpp

12
Marlin/src/gcode/queue.cpp

@ -387,9 +387,15 @@ inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD
}
#endif
buff[ind++] = c;
if (ind >= MAX_CMD_SIZE - 1)
sis = PS_EOL; // Skip the rest on overflow
// Backspace erases previous characters
if (c == 0x08) {
if (ind) buff[--ind] = '\0';
}
else {
buff[ind++] = c;
if (ind >= MAX_CMD_SIZE - 1)
sis = PS_EOL; // Skip the rest on overflow
}
}
/**

Loading…
Cancel
Save