Explorar el Código

Fix G-code parser with MMU2 (#13951)

Giuliano Zaro hace 6 años
padre
commit
f22c9a1ae1
Se han modificado 1 ficheros con 7 adiciones y 11 borrados
  1. 7
    11
      Marlin/src/gcode/parser.cpp

+ 7
- 11
Marlin/src/gcode/parser.cpp Ver fichero

142
       // Skip spaces to get the numeric part
142
       // Skip spaces to get the numeric part
143
       while (*p == ' ') p++;
143
       while (*p == ' ') p++;
144
 
144
 
145
-      // Bail if there's no command code number
146
-      // Prusa MMU2 has T?/Tx/Tc commands
147
-      #if DISABLED(PRUSA_MMU2)
148
-        if (!NUMERIC(*p)) return;
149
-      #endif
150
-
151
-      // Save the command letter at this point
152
-      // A '?' signifies an unknown command
153
-      command_letter = letter;
154
-
155
-
156
       #if ENABLED(PRUSA_MMU2)
145
       #if ENABLED(PRUSA_MMU2)
157
         if (letter == 'T') {
146
         if (letter == 'T') {
158
           // check for special MMU2 T?/Tx/Tc commands
147
           // check for special MMU2 T?/Tx/Tc commands
159
           if (*p == '?' || *p == 'x' || *p == 'c') {
148
           if (*p == '?' || *p == 'x' || *p == 'c') {
149
+            command_letter = letter;
160
             string_arg = p;
150
             string_arg = p;
161
             return;
151
             return;
162
           }
152
           }
163
         }
153
         }
164
       #endif
154
       #endif
165
 
155
 
156
+      // Bail if there's no command code number
157
+      if (!NUMERIC(*p)) return;
158
+
159
+      // Save the command letter at this point
160
+      // A '?' signifies an unknown command
161
+      command_letter = letter;
166
 
162
 
167
       // Get the code number - integer digits only
163
       // Get the code number - integer digits only
168
       codenum = 0;
164
       codenum = 0;

Loading…
Cancelar
Guardar