diff --git a/Marlin/src/feature/bedlevel/bedlevel.cpp b/Marlin/src/feature/bedlevel/bedlevel.cpp index e6bc47a62b..f4a17b0035 100644 --- a/Marlin/src/feature/bedlevel/bedlevel.cpp +++ b/Marlin/src/feature/bedlevel/bedlevel.cpp @@ -130,23 +130,25 @@ TemporaryBedLevelingState::TemporaryBedLevelingState(const bool enable) : saved( */ void reset_bed_level() { if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPGM("reset_bed_level"); - set_bed_leveling_enabled(false); - #if ENABLED(MESH_BED_LEVELING) - mbl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_UBL) + #if ENABLED(AUTO_BED_LEVELING_UBL) ubl.reset(); - #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) - bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = - bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; - for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) - for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { - z_values[x][y] = NAN; - #if ENABLED(EXTENSIBLE_UI) - ExtUI::onMeshUpdate(x, y, 0); - #endif - } - #elif ABL_PLANAR - planner.bed_level_matrix.set_to_identity(); + #else + set_bed_leveling_enabled(false); + #if ENABLED(MESH_BED_LEVELING) + mbl.reset(); + #elif ENABLED(AUTO_BED_LEVELING_BILINEAR) + bilinear_start[X_AXIS] = bilinear_start[Y_AXIS] = + bilinear_grid_spacing[X_AXIS] = bilinear_grid_spacing[Y_AXIS] = 0; + for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) + for (uint8_t y = 0; y < GRID_MAX_POINTS_Y; y++) { + z_values[x][y] = NAN; + #if ENABLED(EXTENSIBLE_UI) + ExtUI::onMeshUpdate(x, y, 0); + #endif + } + #elif ABL_PLANAR + planner.bed_level_matrix.set_to_identity(); + #endif #endif } diff --git a/Marlin/src/feature/bedlevel/ubl/ubl.cpp b/Marlin/src/feature/bedlevel/ubl/ubl.cpp index 341436e95d..f41c80f88a 100644 --- a/Marlin/src/feature/bedlevel/ubl/ubl.cpp +++ b/Marlin/src/feature/bedlevel/ubl/ubl.cpp @@ -97,9 +97,6 @@ const bool was_enabled = planner.leveling_active; set_bed_leveling_enabled(false); storage_slot = -1; - #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) - planner.set_z_fade_height(10.0); - #endif ZERO(z_values); #if ENABLED(EXTENSIBLE_UI) for (uint8_t x = 0; x < GRID_MAX_POINTS_X; x++) diff --git a/Marlin/src/module/configuration_store.cpp b/Marlin/src/module/configuration_store.cpp index f12e377af3..ad3f6f4dcb 100644 --- a/Marlin/src/module/configuration_store.cpp +++ b/Marlin/src/module/configuration_store.cpp @@ -2061,7 +2061,7 @@ void MarlinSettings::postprocess() { } else { ubl.reset(); - DEBUG_ECHOLNPGM("UBL System reset()"); + DEBUG_ECHOLNPGM("UBL reset"); } } #endif diff --git a/Marlin/src/module/planner.h b/Marlin/src/module/planner.h index cb74065d9d..79efe349a1 100644 --- a/Marlin/src/module/planner.h +++ b/Marlin/src/module/planner.h @@ -411,15 +411,13 @@ class Planner { */ static inline float fade_scaling_factor_for_z(const float &rz) { static float z_fade_factor = 1; - if (z_fade_height) { - if (rz >= z_fade_height) return 0; - if (last_fade_z != rz) { - last_fade_z = rz; - z_fade_factor = 1 - rz * inverse_z_fade_height; - } - return z_fade_factor; + if (!z_fade_height) return 1; + if (rz >= z_fade_height) return 0; + if (last_fade_z != rz) { + last_fade_z = rz; + z_fade_factor = 1 - rz * inverse_z_fade_height; } - return 1; + return z_fade_factor; } FORCE_INLINE static void force_fade_recalc() { last_fade_z = -999.999f; }