Browse Source

Update M666 for XYZ dual endstops

pull/1/head
Scott Lahteine 7 years ago
parent
commit
d6df0322c2
  1. 43
      Marlin/src/gcode/calibrate/M666.cpp
  2. 2
      Marlin/src/gcode/gcode.h

43
Marlin/src/gcode/calibrate/M666.cpp

@ -59,30 +59,49 @@
#endif #endif
} }
#elif ENABLED(Z_DUAL_ENDSTOPS) // !DELTA && ENABLED(Z_DUAL_ENDSTOPS) #elif ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
#include "../../module/endstops.h" #include "../../module/endstops.h"
/** /**
* M666: For a Dual Endstop setup, set offsets for any 2nd endstops. * M666: Set Dual Endstops offsets for X, Y, and/or Z.
* With no parameters report current offsets.
*/ */
void GcodeSuite::M666() { inline void gcode_M666() {
SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): "); bool report = true;
#if ENABLED(X_DUAL_ENDSTOPS) #if ENABLED(X_DUAL_ENDSTOPS)
if (parser.seen('X')) endstops.x_endstop_adj = parser.value_linear_units(); if (parser.seen('X')) {
SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj); endstops.x_endstop_adj = parser.value_linear_units();
report = false;
}
#endif #endif
#if ENABLED(Y_DUAL_ENDSTOPS) #if ENABLED(Y_DUAL_ENDSTOPS)
if (parser.seen('Y')) endstops.y_endstop_adj = parser.value_linear_units(); if (parser.seen('Y')) {
SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj); endstops.y_endstop_adj = parser.value_linear_units();
report = false;
}
#endif #endif
#if ENABLED(Z_DUAL_ENDSTOPS) #if ENABLED(Z_DUAL_ENDSTOPS)
if (parser.seen('Z')) endstops.z_endstop_adj = parser.value_linear_units(); if (parser.seen('Z')) {
SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj); endstops.z_endstop_adj = parser.value_linear_units();
report = false;
}
#endif #endif
SERIAL_EOL(); if (report) {
SERIAL_ECHOPGM("Dual Endstop Adjustment (mm): ");
#if ENABLED(X_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" X", endstops.x_endstop_adj);
#endif
#if ENABLED(Y_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" Y", endstops.y_endstop_adj);
#endif
#if ENABLED(Z_DUAL_ENDSTOPS)
SERIAL_ECHOPAIR(" Z", endstops.z_endstop_adj);
#endif
SERIAL_EOL();
}
} }
#endif #endif // X_DUAL_ENDSTOPS || Y_DUAL_ENDSTOPS || Z_DUAL_ENDSTOPS
#endif // DELTA || Z_DUAL_ENDSTOPS #endif // DELTA || Z_DUAL_ENDSTOPS

2
Marlin/src/gcode/gcode.h

@ -201,7 +201,7 @@
* M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE) * M603 - Configure filament change: "M603 T<tool> U<unload_length> L<load_length>". (Requires ADVANCED_PAUSE_FEATURE)
* M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE) * M605 - Set Dual X-Carriage movement mode: "M605 S<mode> [X<x_offset>] [R<temp_offset>]". (Requires DUAL_X_CARRIAGE)
* M665 - Set delta configurations: "M665 L<diagonal rod> R<delta radius> S<segments/s> A<rod A trim mm> B<rod B trim mm> C<rod C trim mm> I<tower A trim angle> J<tower B trim angle> K<tower C trim angle>" (Requires DELTA) * M665 - Set delta configurations: "M665 L<diagonal rod> R<delta radius> S<segments/s> A<rod A trim mm> B<rod B trim mm> C<rod C trim mm> I<tower A trim angle> J<tower B trim angle> K<tower C trim angle>" (Requires DELTA)
* M666 - Set delta endstop adjustment. (Requires DELTA) * M666 - Set/get offsets for delta (Requires DELTA) or dual endstops (Requires [XYZ]_DUAL_ENDSTOPS).
* M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES) * M701 - Load filament (requires FILAMENT_LOAD_UNLOAD_GCODES)
* M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES) * M702 - Unload filament (requires FILAMENT_LOAD_UNLOAD_GCODES)
* M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.) * M851 - Set Z probe's Z offset in current units. (Negative = below the nozzle.)

Loading…
Cancel
Save