From ebda4663c3a3cc7a9aab03e50d1a0bd255809582 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Fri, 2 Jun 2017 19:22:40 -0500 Subject: [PATCH 1/2] for discusion --- Marlin/gcode.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Marlin/gcode.cpp b/Marlin/gcode.cpp index caceb09bd..713b08910 100644 --- a/Marlin/gcode.cpp +++ b/Marlin/gcode.cpp @@ -220,8 +220,10 @@ void GCodeParser::parse(char *p) { #endif } - while (*p && *p != ' ') p++; // Skip over the parameter - while (*p == ' ') p++; // Skip over all spaces + if (!WITHIN(*p, 'A', 'Z')) { + while (*p && NUMERIC(*p)) p++; // Skip over the parameter + while (*p == ' ') p++; // Skip over all spaces + } } } From 2130f10de8e3a6aa28f1a2df4ef93e3f15c7d828 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Fri, 2 Jun 2017 19:57:22 -0500 Subject: [PATCH 2/2] allow space between parameter and value --- Marlin/gcode.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Marlin/gcode.cpp b/Marlin/gcode.cpp index 713b08910..0cb233733 100644 --- a/Marlin/gcode.cpp +++ b/Marlin/gcode.cpp @@ -183,7 +183,8 @@ void GCodeParser::parse(char *p) { #endif if (PARAM_TEST) { - + + while (*p == ' ') p++; // skip spaces vetween parameters & values const bool has_num = DECIMAL_SIGNED(*p); // The parameter has a number [-+0-9.] #if ENABLED(DEBUG_GCODE_PARSER) @@ -221,7 +222,7 @@ void GCodeParser::parse(char *p) { } if (!WITHIN(*p, 'A', 'Z')) { - while (*p && NUMERIC(*p)) p++; // Skip over the parameter + while (*p && NUMERIC(*p)) p++; // Skip over the value section of a parameter while (*p == ' ') p++; // Skip over all spaces } }