From f4a69281fc17835558755ae76ab8cfedcb52da5d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Thu, 14 Jul 2016 23:40:48 -0700 Subject: [PATCH] Only call mesh_buffer_line when MBL is active --- Marlin/Marlin_main.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index a1f454df6c..389818c580 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -7842,11 +7842,6 @@ void clamp_to_software_endstops(float target[3]) { // This function is used to split lines on mesh borders so each segment is only part of one mesh area void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, const uint8_t& extruder, uint8_t x_splits = 0xff, uint8_t y_splits = 0xff) { - if (!mbl.active()) { - planner.buffer_line(x, y, z, e, fr_mm_s, extruder); - set_current_to_destination(); - return; - } int pcx = mbl.cell_index_x(RAW_CURRENT_POSITION(X_AXIS)), pcy = mbl.cell_index_y(RAW_CURRENT_POSITION(Y_AXIS)), cx = mbl.cell_index_x(RAW_POSITION(x, X_AXIS)), @@ -8007,11 +8002,13 @@ void mesh_buffer_line(float x, float y, float z, const float e, float fr_mm_s, c } else { #if ENABLED(MESH_BED_LEVELING) - mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); - return false; - #else - line_to_destination(MMM_SCALED(feedrate_mm_m)); + if (mbl.active()) { + mesh_buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS], destination[E_AXIS], MMM_TO_MMS_SCALED(feedrate_mm_m), active_extruder); + return false; + } + else #endif + line_to_destination(MMM_SCALED(feedrate_mm_m)); } return true; }