Skip to content
Snippets Groups Projects
Commit bc2ff9b4 authored by Scott Lahteine's avatar Scott Lahteine
Browse files

Fix M605 bugs

Fixes #14191
parent f7792c01
No related branches found
No related tags found
No related merge requests found
...@@ -158,11 +158,12 @@ ...@@ -158,11 +158,12 @@
* A value of 0 disables duplication. * A value of 0 disables duplication.
*/ */
void GcodeSuite::M605() { void GcodeSuite::M605() {
bool ena = false;
if (parser.seen("EPS")) { if (parser.seen("EPS")) {
planner.synchronize(); planner.synchronize();
if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly if (parser.seenval('P')) duplication_e_mask = parser.value_int(); // Set the mask directly
else if (parser.seenval('E')) duplication_e_mask = pow(2, e + 1) - 1; // Set the mask by E index else if (parser.seenval('E')) duplication_e_mask = pow(2, parser.value_int() + 1) - 1; // Set the mask by E index
const bool ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0)); ena = (2 == parser.intval('S', extruder_duplication_enabled ? 2 : 0));
extruder_duplication_enabled = ena && (duplication_e_mask >= 3); extruder_duplication_enabled = ena && (duplication_e_mask >= 3);
} }
SERIAL_ECHO_START(); SERIAL_ECHO_START();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment