Move fade_scaling_factor_for_z to Planner

This commit is contained in:
Scott Lahteine
2017-10-13 10:39:11 -05:00
parent 9a930ebec2
commit ca1e47375c
5 changed files with 65 additions and 76 deletions

View File

@ -134,20 +134,16 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
const bool level_active = LEVELING_IS_ACTIVE();
#if ENABLED(AUTO_BED_LEVELING_UBL)
if (level_active) set_bed_leveling_enabled(false); // turn off before changing fade height for proper apply/unapply leveling to maintain current_position
#endif
if (level_active)
set_bed_leveling_enabled(false); // turn off before changing fade height for proper apply/unapply leveling to maintain current_position
planner.z_fade_height = zfh;
planner.inverse_z_fade_height = RECIPROCAL(zfh);
if (level_active)
planner.z_fade_height = zfh;
planner.inverse_z_fade_height = RECIPROCAL(zfh);
if (level_active) {
#if ENABLED(AUTO_BED_LEVELING_UBL)
set_bed_leveling_enabled(true); // turn back on after changing fade height
#else
planner.z_fade_height = zfh;
planner.inverse_z_fade_height = RECIPROCAL(zfh);
if (level_active) {
#else
set_current_from_steppers_for_axis(
#if ABL_PLANAR
ALL_AXES
@ -155,8 +151,8 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) {
Z_AXIS
#endif
);
}
#endif
#endif
}
}
#endif // ENABLE_LEVELING_FADE_HEIGHT