mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-25 04:48:31 +00:00
Tweak escape handling in serial input
This commit is contained in:
parent
68cc5c72fd
commit
96bcf08477
@ -1136,11 +1136,8 @@ inline void get_serial_commands() {
|
|||||||
// The command will be injected when EOL is reached
|
// The command will be injected when EOL is reached
|
||||||
}
|
}
|
||||||
else if (serial_char == '\\') { // Handle escapes
|
else if (serial_char == '\\') { // Handle escapes
|
||||||
if ((c = MYSERIAL.read()) >= 0) {
|
if ((c = MYSERIAL.read()) >= 0 && !serial_comment_mode) // if we have one more character, copy it over
|
||||||
// if we have one more character, copy it over
|
serial_line_buffer[serial_count++] = (char)c;
|
||||||
serial_char = c;
|
|
||||||
if (!serial_comment_mode) serial_line_buffer[serial_count++] = serial_char;
|
|
||||||
}
|
|
||||||
// otherwise do nothing
|
// otherwise do nothing
|
||||||
}
|
}
|
||||||
else { // it's not a newline, carriage return or escape char
|
else { // it's not a newline, carriage return or escape char
|
||||||
|
Loading…
Reference in New Issue
Block a user