Skip to content

Commit 471b5ac

Browse files
sjasonsmiththinkyhead
authored andcommitted
Leveling Fade Height default setting (MarlinFirmware#20316)
1 parent 04f7053 commit 471b5ac

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
@@ -1295,6 +1295,9 @@
12951295
// at which point movement will be level to the machine's XY plane.
12961296
// The height can be set with M420 Z<height>
12971297
#define ENABLE_LEVELING_FADE_HEIGHT
1298+
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
1299+
#define DEFAULT_LEVELING_FADE_HEIGHT 10.0 // (mm) Default fade height.
1300+
#endif
12981301

12991302
// For Cartesian machines, instead of dividing moves on mesh boundaries,
13001303
// 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
@@ -2447,6 +2447,10 @@
24472447
#endif
24482448
#endif
24492449

2450+
#ifndef DEFAULT_LEVELING_FADE_HEIGHT
2451+
#define DEFAULT_LEVELING_FADE_HEIGHT 0.0
2452+
#endif
2453+
24502454
#if ENABLED(SEGMENT_LEVELED_MOVES) && !defined(LEVELED_SEGMENT_LENGTH)
24512455
#define LEVELED_SEGMENT_LENGTH 5
24522456
#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)