From 4b8da604775d7979f04262c978986ae6e0326b10 Mon Sep 17 00:00:00 2001 From: Mjolnir Date: Fri, 4 Sep 2015 11:44:03 +0200 Subject: [PATCH] fix compatibility between identification and arcs --- GCodeParser/GCodeParser.ino | 2 +- GCodeParser/process_string.ino | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/GCodeParser/GCodeParser.ino b/GCodeParser/GCodeParser.ino index b9f755b..b4ce07d 100644 --- a/GCodeParser/GCodeParser.ino +++ b/GCodeParser/GCodeParser.ino @@ -116,7 +116,7 @@ void loop() else if (serial_count < COMMAND_SIZE) { commands[serial_count] = c; - serial_count++ + serial_count++; } } else diff --git a/GCodeParser/process_string.ino b/GCodeParser/process_string.ino index 9033296..82dcc73 100644 --- a/GCodeParser/process_string.ino +++ b/GCodeParser/process_string.ino @@ -65,14 +65,13 @@ void process_string(char instruction[], int size) //did we get a gcode? - if (has_command('I', instruction, size)) - { + if (instruction[0] == 'I') Serial.println(F("XYPlotter")); - } - else if (has_command('C', instruction, size)) + else if (instruction[0] == 'C') { init_steppers(); process_string("G90",3);//Absolute Position + process_string("G21",3);//mm units } else if (!has_command('$', instruction, size)&&( has_command('G', instruction, size) || -- 2.30.2