From aa616cd410dfd91c2fb302fc9c317a7a96ab3e7c Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 12 Nov 2017 23:06:16 -0600 Subject: [PATCH] No leveling data in M114 without leveling --- Marlin/Marlin_main.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index d54305a77..34a4016e9 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8508,15 +8508,17 @@ void report_current_position() { 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); - - SERIAL_PROTOCOLPGM("UnLevel:"); - float unleveled[XYZ] = { leveled[X_AXIS], leveled[Y_AXIS], leveled[Z_AXIS] }; - planner.unapply_leveling(unleveled); - report_xyz(unleveled); + #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); + #endif #if IS_KINEMATIC #if IS_SCARA