From df0a0c9490346f57e1b8224cb0fe7a1ad46d76bb Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 29 Nov 2020 13:00:08 -0800 Subject: [PATCH] Leveling Fade Height default setting (#20316) --- Marlin/Configuration.h | 3 +++ Marlin/src/inc/Conditionals_post.h | 4 ++++ Marlin/src/module/settings.cpp | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 0e529b3462..ebc3311d9e 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1291,6 +1291,9 @@ // at which point movement will be level to the machine's XY plane. // The height can be set with M420 Z #define ENABLE_LEVELING_FADE_HEIGHT + #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) + #define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height. + #endif // For Cartesian machines, instead of dividing moves on mesh boundaries, // split up moves into short segments like a Delta. This follows the diff --git a/Marlin/src/inc/Conditionals_post.h b/Marlin/src/inc/Conditionals_post.h index 35fd92e10b..dfecd57749 100644 --- a/Marlin/src/inc/Conditionals_post.h +++ b/Marlin/src/inc/Conditionals_post.h @@ -2448,6 +2448,10 @@ #endif #endif +#ifndef DEFAULT_LEVELING_FADE_HEIGHT + #define DEFAULT_LEVELING_FADE_HEIGHT 0.0 +#endif + #if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH) #define LEVELED_SEGMENT_LENGTH 5 #endif diff --git a/Marlin/src/module/settings.cpp b/Marlin/src/module/settings.cpp index c49c643b60..c6eee271a0 100644 --- a/Marlin/src/module/settings.cpp +++ b/Marlin/src/module/settings.cpp @@ -696,7 +696,7 @@ void MarlinSettings::postprocess() { // Global Leveling // { - const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, 10.0f); + const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, (DEFAULT_LEVELING_FADE_HEIGHT)); EEPROM_WRITE(zfh); } @@ -2588,7 +2588,7 @@ void MarlinSettings::reset() { // // Global Leveling // - TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = 0.0); + TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT)); TERN_(HAS_LEVELING, reset_bed_level()); #if HAS_BED_PROBE