Add G-code "backspace" support
This commit is contained in:
parent
265ab19ed2
commit
ca5a8ea827
1 changed files with 9 additions and 3 deletions
|
@ -387,9 +387,15 @@ inline void process_stream_char(const char c, uint8_t &sis, char (&buff)[MAX_CMD
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
buff[ind++] = c;
|
// Backspace erases previous characters
|
||||||
if (ind >= MAX_CMD_SIZE - 1)
|
if (c == 0x08) {
|
||||||
sis = PS_EOL; // Skip the rest on overflow
|
if (ind) buff[--ind] = '\0';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
buff[ind++] = c;
|
||||||
|
if (ind >= MAX_CMD_SIZE - 1)
|
||||||
|
sis = PS_EOL; // Skip the rest on overflow
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Reference in a new issue