Browse Source

Fix M605 bugs

Fixes #14191
Scott Lahteine 6 years ago
parent
commit
bc2ff9b41f
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      Marlin/src/gcode/control/M605.cpp

+ 3
- 2
Marlin/src/gcode/control/M605.cpp View File

@@ -158,11 +158,12 @@
158 158
    *             A value of 0 disables duplication.
159 159
    */
160 160
   void GcodeSuite::M605() {
161
+    bool ena = false;
161 162
     if (parser.seen("EPS")) {
162 163
       planner.synchronize();
163 164
       if (parser.seenval('P')) duplication_e_mask = parser.value_int();   // Set the mask directly
164
-      else if (parser.seenval('E')) duplication_e_mask = pow(2, e + 1) - 1;    // Set the mask by E index
165
-      const bool ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
165
+      else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index
166
+      ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
166 167
       extruder_duplication_enabled = ena && (duplication_e_mask >= 3);
167 168
     }
168 169
     SERIAL_ECHO_START();

Loading…
Cancel
Save