From cc3204509c610baf7913e4d5653c95dea1583899 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 20 Mar 2017 15:38:25 -0500 Subject: [PATCH] UBL patch from Bob-the-Kuhn --- Marlin/Marlin_main.cpp | 18 +++++++++++++++--- Marlin/enum.h | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) mode change 100644 => 100755 Marlin/Marlin_main.cpp mode change 100644 => 100755 Marlin/enum.h diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp old mode 100644 new mode 100755 index 18fffc911e..7537f2033f --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -508,7 +508,13 @@ static uint8_t target_extruder; #endif #if ENABLED(Z_DUAL_ENDSTOPS) - float z_endstop_adj = 0; + float z_endstop_adj = + #ifdef Z_DUAL_ENDSTOPS_ADJUSTMENT + Z_DUAL_ENDSTOPS_ADJUSTMENT + #else + 0 + #endif + ; #endif // Extruder offsets @@ -2281,7 +2287,7 @@ static void clean_up_after_endstop_or_probe_move() { if (enable) planner.unapply_leveling(current_position); } - #elif HAS_ABL + #elif HAS_ABL && !ENABLED(AUTO_BED_LEVELING_UBL) #if ENABLED(AUTO_BED_LEVELING_BILINEAR) const bool can_change = (!enable || (bilinear_grid_spacing[0] && bilinear_grid_spacing[1])); @@ -2302,7 +2308,11 @@ static void clean_up_after_endstop_or_probe_move() { else planner.unapply_leveling(current_position); } - + #elif ENABLED(AUTO_BED_LEVELING_UBL) + if (blm.state.EEPROM_storage_slot == 0) { + blm.state.active = enable; + blm.store_state(); + } #endif } @@ -7139,6 +7149,8 @@ void quickstop_stepper() { const bool new_status = #if ENABLED(MESH_BED_LEVELING) mbl.active() + #elif ENABLED(AUTO_BED_LEVELING_UBL) + blm.state.active #else planner.abl_enabled #endif diff --git a/Marlin/enum.h b/Marlin/enum.h old mode 100644 new mode 100755 index 9175696a5b..70d7256488 --- a/Marlin/enum.h +++ b/Marlin/enum.h @@ -75,6 +75,7 @@ enum DebugFlags { DEBUG_DRYRUN = _BV(3), ///< Ignore temperature setting and E movement commands DEBUG_COMMUNICATION = _BV(4), ///< Not implemented DEBUG_LEVELING = _BV(5), ///< Print detailed output for homing and leveling + DEBUG_MESH_ADJUST = _BV(6), ///< UBL bed leveling DEBUG_ALL = 0xFF };