From ff304d3767ebfbe1dbcde3703bc4fe5aee1587a4 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 21 Mar 2018 01:38:25 -0500 Subject: [PATCH] Allow G53 to go back to native space --- Marlin/src/gcode/geometry/G53-G59.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Marlin/src/gcode/geometry/G53-G59.cpp b/Marlin/src/gcode/geometry/G53-G59.cpp index 4739fe458..ac4c2fd58 100644 --- a/Marlin/src/gcode/geometry/G53-G59.cpp +++ b/Marlin/src/gcode/geometry/G53-G59.cpp @@ -50,15 +50,18 @@ } /** - * In CNC G-code G53 is like a modifier + * G53: Apply native workspace to the current move + * + * In CNC G-code G53 is a modifier. * It precedes a movement command (or other modifiers) on the same line. * This is the first command to use parser.chain() to make this possible. + * + * Marlin also uses G53 on a line by itself to go back to native space. */ - void GcodeSuite::G53() { - // If this command has more following... - if (parser.chain()) { - const int8_t _system = active_coordinate_system; - active_coordinate_system = -1; + inline void gcode_G53() { + const int8_t _system = active_coordinate_system; + active_coordinate_system = -1; + if (parser.chain()) { // If this command has more following... process_parsed_command(); active_coordinate_system = _system; }