From a0125dedfc316e0d49172bcc80a068773dfdf305 Mon Sep 17 00:00:00 2001 From: konoppo Date: Tue, 6 Jan 2015 00:47:27 +0100 Subject: [PATCH] gcode_parse.c: don't assume G1 on pure M- or T-codes. Offending code were lines like these from Repetier Host: N8965 M117 ETE 29m 10s *86 When firmware received not-G command (M-command or T-command) with X, Y, Z, E or F coordinate, it will "change" this command to G1. Now, firmware do change only if received line is not either G- or M- or T-command. Examples: X10 - is changed to G1 X10 E20 F300 - is changed to G1 E20 F300 M117 E1 - is NOT changed to G1 E1 This commit costs 6 bytes binary size. --- gcode_parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcode_parse.c b/gcode_parse.c index fc7c2bf..0668513 100644 --- a/gcode_parse.c +++ b/gcode_parse.c @@ -324,7 +324,7 @@ void gcode_parse_char(uint8_t c) { serial_writechar(c); // Assume G1 for unspecified movements. - if ( ! next_target.seen_G && + if ( ! next_target.seen_G && ! next_target.seen_M && ! next_target.seen_T && (next_target.seen_X || next_target.seen_Y || next_target.seen_Z || next_target.seen_E || next_target.seen_F)) { next_target.seen_G = 1;