Skip to content

Commit

Permalink
Leveling Fade Height default setting (MarlinFirmware#20316)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjasonsmith authored and vgadreau committed Dec 9, 2020
1 parent f905809 commit 30c97ac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Marlin/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -1302,6 +1302,9 @@
// at which point movement will be level to the machine's XY plane.
// The height can be set with M420 Z<height>
#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
Expand Down
4 changes: 4 additions & 0 deletions Marlin/src/inc/Conditionals_post.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 30c97ac

Please sign in to comment.