From e8e92f896946165f47300b3ba03e54f5e042e099 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Nov 2017 23:03:38 -0600 Subject: [PATCH] No leveling data in M114 if no leveling is enabled --- Marlin/src/gcode/host/M114.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Marlin/src/gcode/host/M114.cpp b/Marlin/src/gcode/host/M114.cpp index cf901884a1..aa968ed3d2 100644 --- a/Marlin/src/gcode/host/M114.cpp +++ b/Marlin/src/gcode/host/M114.cpp @@ -56,15 +56,17 @@ SERIAL_PROTOCOLPGM("Raw: "); report_xyz(current_position); - SERIAL_PROTOCOLPGM("Leveled:"); - float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; - planner.apply_leveling(leveled); - report_xyz(leveled); + #if PLANNER_LEVELING + SERIAL_PROTOCOLPGM("Leveled:"); + float leveled[XYZ] = { current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS] }; + planner.apply_leveling(leveled); + report_xyz(leveled); - SERIAL_PROTOCOLPGM("UnLevel:"); - float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; - planner.unapply_leveling(unleveled); - report_xyz(unleveled); + SERIAL_PROTOCOLPGM("UnLevel:"); + float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; + planner.unapply_leveling(unleveled); + report_xyz(unleveled); + #endif #if IS_KINEMATIC #if IS_SCARA