Browse Source

Merge pull request #6940 from Bob-the-Kuhn/Gcode---allow-XY

Gcode.cpp - spaces and parameters
Bob-the-Kuhn 7 years ago
parent
commit
fff50d3958
1 changed files with 6 additions and 3 deletions
  1. 6
    3
      Marlin/gcode.cpp

+ 6
- 3
Marlin/gcode.cpp View File

@@ -183,7 +183,8 @@ void GCodeParser::parse(char *p) {
183 183
     #endif
184 184
 
185 185
     if (PARAM_TEST) {
186
-
186
+    
187
+      while (*p == ' ') p++;                    // skip spaces vetween parameters & values
187 188
       const bool has_num = DECIMAL_SIGNED(*p);  // The parameter has a number [-+0-9.]
188 189
 
189 190
       #if ENABLED(DEBUG_GCODE_PARSER)
@@ -220,8 +221,10 @@ void GCodeParser::parse(char *p) {
220 221
       #endif
221 222
     }
222 223
 
223
-    while (*p && *p != ' ') p++;                // Skip over the parameter
224
-    while (*p == ' ') p++;                      // Skip over all spaces
224
+    if (!WITHIN(*p, 'A', 'Z')) {
225
+      while (*p && NUMERIC(*p)) p++;              // Skip over the value section of a parameter
226
+      while (*p == ' ') p++;                      // Skip over all spaces
227
+    }
225 228
   }
226 229
 }
227 230
 

Loading…
Cancel
Save