From aed1d17a2d0495234f015eece3d035d07212673e Mon Sep 17 00:00:00 2001 From: Giuliano <3684609+GMagician@users.noreply.github.com> Date: Wed, 18 Jul 2018 02:37:30 +0200 Subject: [PATCH] Initialize default units (#11295) When `INCH_MODE_SUPPORT` is enabled no default unit is set. This fixes it. --- Marlin/src/gcode/parser.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/src/gcode/parser.h b/Marlin/src/gcode/parser.h index e14889d62..82843d622 100644 --- a/Marlin/src/gcode/parser.h +++ b/Marlin/src/gcode/parser.h @@ -85,7 +85,7 @@ public: #endif #if ENABLED(DEBUG_GCODE_PARSER) - void debug(); + static void debug(); #endif // Reset is done before parsing @@ -217,6 +217,9 @@ public: #if ENABLED(INCH_MODE_SUPPORT) + // Init linear units by constructor + GCodeParser() { set_input_linear_units(LINEARUNIT_MM); } + inline static void set_input_linear_units(const LinearUnit units) { switch (units) { case LINEARUNIT_INCH: