Skip to content

Commit 30c97ac

Browse files
sjasonsmithvgadreau
authored andcommitted
Leveling Fade Height default setting (MarlinFirmware#20316)
1 parent f905809 commit 30c97ac

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Marlin/Configuration.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,9 @@
13021302
// at which point movement will be level to the machine's XY plane.
13031303
// The height can be set with M420 Z<height>
13041304
#define ENABLE_LEVELING_FADE_HEIGHT
1305+
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1306+
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.
1307+
#endif
13051308

13061309
// For Cartesian machines, instead of dividing moves on mesh boundaries,
13071310
// split up moves into short segments like a Delta. This follows the

Marlin/src/inc/Conditionals_post.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,10 @@
24482448
#endif
24492449
#endif
24502450

2451+
#ifndef DEFAULT_LEVELING_FADE_HEIGHT
2452+
#define DEFAULT_LEVELING_FADE_HEIGHT 0.0
2453+
#endif
2454+
24512455
#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
24522456
#define LEVELED_SEGMENT_LENGTH 5
24532457
#endif

Marlin/src/module/settings.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ void MarlinSettings::postprocess() {
696696
// Global Leveling
697697
//
698698
{
699-
const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, 10.0f);
699+
const float zfh = TERN(ENABLE_LEVELING_FADE_HEIGHT, planner.z_fade_height, (DEFAULT_LEVELING_FADE_HEIGHT));
700700
EEPROM_WRITE(zfh);
701701
}
702702

@@ -2588,7 +2588,7 @@ void MarlinSettings::reset() {
25882588
//
25892589
// Global Leveling
25902590
//
2591-
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = 0.0);
2591+
TERN_(ENABLE_LEVELING_FADE_HEIGHT, new_z_fade_height = (DEFAULT_LEVELING_FADE_HEIGHT));
25922592
TERN_(HAS_LEVELING, reset_bed_level());
25932593

25942594
#if HAS_BED_PROBE

0 commit comments

Comments
 (0)