From 5de1da2b3cdba5ac3e5e7077f958644683bc30ec Mon Sep 17 00:00:00 2001 From: Roxy-3D Date: Thu, 23 Mar 2017 04:40:53 -0500 Subject: [PATCH] Make UBL honor the #define ENABLE_LEVELING_FADE_HEIGHT option --- Marlin/UBL.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Marlin/UBL.h b/Marlin/UBL.h index 9aa34f3c7..11d7c2fd9 100644 --- a/Marlin/UBL.h +++ b/Marlin/UBL.h @@ -312,6 +312,9 @@ * or if the current Z Height is past the specified 'Fade Height' */ FORCE_INLINE float fade_scaling_factor_for_z(float current_z) { + #ifndef ENABLE_LEVELING_FADE_HEIGHT // if turned off, just return 0.000 Note that we assume the + return 0.000; // compiler will do 'Dead Code' elimination so there is no need + #endif // for an #else clause here. if (last_specified_z == current_z) return fade_scaling_factor_for_current_height; @@ -328,4 +331,4 @@ extern int ubl_eeprom_start; #endif // AUTO_BED_LEVELING_UBL -#endif // UNIFIED_BED_LEVELING_H \ No newline at end of file +#endif // UNIFIED_BED_LEVELING_H