From ab2d302b7edfe22c7bf40392e1a29fb4dcbb154d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 24 Nov 2019 21:10:51 -0500 Subject: [PATCH] gcode: Remove support for the M206 command The M206 command isn't particularly standardized and isn't issued by default from 3rd party software in their standard configurations. Encourage users to use the more powerful SET_GCODE_OFFSET command. Signed-off-by: Kevin O'Connor --- docs/Config_Changes.md | 5 +++++ docs/G-Codes.md | 2 -- klippy/gcode.py | 10 +--------- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index a6f5661fd..0e479ce92 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -6,6 +6,11 @@ All dates in this document are approximate. # Changes +20191210: Support for the M206 command has been removed. Replace with +calls to SET_GCODE_OFFSET. If support for M206 is needed, add a +[gcode_macro M206] config section that calls SET_GCODE_OFFSET. (For +example "SET_GCODE_OFFSET Z=-{params.Z}".) + 20191202: Support for the undocumented "S" parameter of the "G4" command has been removed. Replace any occurrences of S with the standard "P" parameter (the delay specified in milliseconds). diff --git a/docs/G-Codes.md b/docs/G-Codes.md index ad5481b17..029c9ae01 100644 --- a/docs/G-Codes.md +++ b/docs/G-Codes.md @@ -83,8 +83,6 @@ config section is enabled: The following standard G-Code commands are currently available, but using them is not recommended: -- Offset axes: `M206 [X] [Y] [Z]` (Use - SET_GCODE_OFFSET instead.) - Get Endstop Status: `M119` (Use QUERY_ENDSTOPS instead.) # Extended G-Code Commands diff --git a/klippy/gcode.py b/klippy/gcode.py index cd2fcd9e4..93e97ec76 100644 --- a/klippy/gcode.py +++ b/klippy/gcode.py @@ -476,7 +476,7 @@ class GCodeParser: all_handlers = [ 'G1', 'G4', 'G28', 'M400', 'G20', 'M82', 'M83', 'G90', 'G91', 'G92', 'M114', 'M220', 'M221', - 'SET_GCODE_OFFSET', 'M206', 'SAVE_GCODE_STATE', 'RESTORE_GCODE_STATE', + 'SET_GCODE_OFFSET', 'SAVE_GCODE_STATE', 'RESTORE_GCODE_STATE', 'M105', 'M104', 'M109', 'M140', 'M190', 'M112', 'M115', 'IGNORE', 'GET_POSITION', 'RESTART', 'FIRMWARE_RESTART', 'ECHO', 'STATUS', 'HELP'] @@ -599,14 +599,6 @@ class GCodeParser: for pos, delta in enumerate(move_delta): self.last_position[pos] += delta self.move_with_transform(self.last_position, speed) - def cmd_M206(self, params): - # Offset axes - offsets = { self.axis2pos[a]: -self.get_float(a, params) - for a in 'XYZ' if a in params } - for pos, offset in offsets.items(): - delta = offset - self.homing_position[pos] - self.base_position[pos] += delta - self.homing_position[pos] = offset cmd_SAVE_GCODE_STATE_help = "Save G-Code coordinate state" def cmd_SAVE_GCODE_STATE(self, params): state_name = self.get_str('NAME', params, 'default')