From d49600ec21ba22ea30ef034b338c55e148903f00 Mon Sep 17 00:00:00 2001 From: Marcio Teixeira Date: Thu, 2 Nov 2017 14:47:00 -0600 Subject: [PATCH] Fix for G28 disabling bed leveling comp. (T1258) G28 was disabling bed leveling on entry, but not re-enabling it on exit. This bug in upstream was probably not caught as G28 is most often followed by G29. However, Cura now rehomes X/Y after pausing a print, so it is necessary that G28 keep bed leveling information. --- Marlin/Conditionals_LulzBot.h | 8 +++++++- Marlin/Marlin_main.cpp | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Marlin/Conditionals_LulzBot.h b/Marlin/Conditionals_LulzBot.h index 3034418eb..2ceb9c9d4 100644 --- a/Marlin/Conditionals_LulzBot.h +++ b/Marlin/Conditionals_LulzBot.h @@ -13,7 +13,7 @@ * got disabled. */ -#define LULZBOT_FW_VERSION ".26" // Change this with each update +#define LULZBOT_FW_VERSION ".27" // Change this with each update #if ( \ !defined(LULZBOT_Gladiola_Mini) && \ @@ -260,6 +260,12 @@ // Q&A wants to be able to use M226 on endstops switches #define LULZBOT_NO_PIN_PROTECTION_ON_M226 +// Marlin 1.1.5 has an issue where bed leveling is disabled when homing, +// this causes problems when rehoming X/Y after pausing a print. +#if defined(LULZBOT_USE_AUTOLEVELING) + #define LULZBOT_G28_DISABLES_LEVELING_WORKAROUND +#endif + /******************** MOTHERBOARD AND PIN CONFIGURATION ***********************/ #if defined(TOOLHEAD_Devel_ServoDual) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index e8be3ec6e..fdb1acd83 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3940,7 +3940,7 @@ inline void gcode_G28(const bool always_home_all) { // Disable the leveling matrix before homing #if HAS_LEVELING - #if ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(AUTO_BED_LEVELING_UBL) || defined(LULZBOT_G28_DISABLES_LEVELING_WORKAROUND) const bool ubl_state_at_entry = leveling_is_active(); #endif set_bed_leveling_enabled(false); @@ -4093,7 +4093,7 @@ inline void gcode_G28(const bool always_home_all) { do_blocking_move_to_z(delta_clip_start_height); #endif - #if ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(AUTO_BED_LEVELING_UBL) || defined(LULZBOT_G28_DISABLES_LEVELING_WORKAROUND) set_bed_leveling_enabled(ubl_state_at_entry); #endif