|
@ -128,13 +128,17 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { |
|
|
// so compensation will give the right stepper counts.
|
|
|
// so compensation will give the right stepper counts.
|
|
|
planner.unapply_leveling(current_position); |
|
|
planner.unapply_leveling(current_position); |
|
|
|
|
|
|
|
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC(); |
|
|
|
|
|
|
|
|
#endif // OLDSCHOOL_ABL
|
|
|
#endif // OLDSCHOOL_ABL
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) |
|
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT) |
|
|
|
|
|
|
|
|
void set_z_fade_height(const float zfh) { |
|
|
void set_z_fade_height(const float zfh, const bool do_report/*=true*/) { |
|
|
|
|
|
|
|
|
|
|
|
if (planner.z_fade_height == zfh) return; // do nothing if no change
|
|
|
|
|
|
|
|
|
const bool level_active = planner.leveling_active; |
|
|
const bool level_active = planner.leveling_active; |
|
|
|
|
|
|
|
@ -145,6 +149,10 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { |
|
|
planner.set_z_fade_height(zfh); |
|
|
planner.set_z_fade_height(zfh); |
|
|
|
|
|
|
|
|
if (level_active) { |
|
|
if (level_active) { |
|
|
|
|
|
const float oldpos[XYZE] = { |
|
|
|
|
|
current_position[X_AXIS], current_position[Y_AXIS], |
|
|
|
|
|
current_position[Z_AXIS], current_position[E_AXIS] |
|
|
|
|
|
}; |
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
#if ENABLED(AUTO_BED_LEVELING_UBL) |
|
|
set_bed_leveling_enabled(true); // turn back on after changing fade height
|
|
|
set_bed_leveling_enabled(true); // turn back on after changing fade height
|
|
|
#else |
|
|
#else |
|
@ -155,7 +163,10 @@ void set_bed_leveling_enabled(const bool enable/*=true*/) { |
|
|
Z_AXIS |
|
|
Z_AXIS |
|
|
#endif |
|
|
#endif |
|
|
); |
|
|
); |
|
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC(); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
if (do_report && memcmp(oldpos, current_position, sizeof(oldpos))) |
|
|
|
|
|
report_current_position(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|