Accept CR as end of line, by popular request

This commit is contained in:
Michael Moon 2010-02-08 09:57:47 +11:00
parent 91c86beaf0
commit fe9938bcef
1 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ void scan_char(uint8_t c) {
// process previous field // process previous field
if (last_field) { if (last_field) {
// check if we're seeing a new field or end of line // check if we're seeing a new field or end of line
if ((indexof(c, alphabet) >= 0) || (c == 10)) { if ((indexof(c, alphabet) >= 0) || (c == 10) || (c ==13)) {
switch (last_field) { switch (last_field) {
case 'G': case 'G':
next_target.G = read_digit.mantissa; next_target.G = read_digit.mantissa;
@ -263,7 +263,7 @@ void scan_char(uint8_t c) {
} }
// end of line // end of line
if (c == 10) { if ((c == 10) || (c == 13)) {
serial_writechar(c); serial_writechar(c);
// process // process
process_gcode_command(&next_target); process_gcode_command(&next_target);