Ensure babystep_apply|undo always uses the planner
The code around these calls _requires_ that the steps are immediately processed and/or added to the subsequent planner moves. The only part that doesn't care about immediate insertion is the direct user-insertion though the lcd encoder.
This commit is contained in:
parent
ffae16bf95
commit
c241adec5f
|
|
@ -2722,8 +2722,7 @@ static void gcode_G28(bool home_x_axis, long home_x_value, bool home_y_axis, lon
|
||||||
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
current_position[Z_AXIS] = st_get_position_mm(Z_AXIS);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
// Reset baby stepping to zero, if the babystepping has already been loaded before.
|
||||||
// consumed during the first movements following this statement.
|
|
||||||
if (home_z)
|
if (home_z)
|
||||||
babystep_undo();
|
babystep_undo();
|
||||||
|
|
||||||
|
|
@ -5161,8 +5160,7 @@ if(eSoundMode!=e_SOUND_MODE_SILENT)
|
||||||
|
|
||||||
mbl.reset(); //reset mesh bed leveling
|
mbl.reset(); //reset mesh bed leveling
|
||||||
|
|
||||||
// Reset baby stepping to zero, if the babystepping has already been loaded before. The babystepsTodo value will be
|
// Reset baby stepping to zero, if the babystepping has already been loaded before.
|
||||||
// consumed during the first movements following this statement.
|
|
||||||
babystep_undo();
|
babystep_undo();
|
||||||
|
|
||||||
// Cycle through all points and probe them
|
// Cycle through all points and probe them
|
||||||
|
|
|
||||||
|
|
@ -3030,8 +3030,6 @@ static void shift_z(float delta)
|
||||||
plan_set_z_position(current_position[Z_AXIS]);
|
plan_set_z_position(current_position[Z_AXIS]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BABYSTEP_LOADZ_BY_PLANNER
|
|
||||||
|
|
||||||
// Number of baby steps applied
|
// Number of baby steps applied
|
||||||
static int babystepLoadZ = 0;
|
static int babystepLoadZ = 0;
|
||||||
|
|
||||||
|
|
@ -3062,20 +3060,12 @@ void babystep_load()
|
||||||
void babystep_apply()
|
void babystep_apply()
|
||||||
{
|
{
|
||||||
babystep_load();
|
babystep_load();
|
||||||
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
|
||||||
shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_unit[Z_AXIS]));
|
shift_z(- float(babystepLoadZ) / float(cs.axis_steps_per_unit[Z_AXIS]));
|
||||||
#else
|
|
||||||
babystepsTodoZadd(babystepLoadZ);
|
|
||||||
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void babystep_undo()
|
void babystep_undo()
|
||||||
{
|
{
|
||||||
#ifdef BABYSTEP_LOADZ_BY_PLANNER
|
|
||||||
shift_z(float(babystepLoadZ) / float(cs.axis_steps_per_unit[Z_AXIS]));
|
shift_z(float(babystepLoadZ) / float(cs.axis_steps_per_unit[Z_AXIS]));
|
||||||
#else
|
|
||||||
babystepsTodoZsubtract(babystepLoadZ);
|
|
||||||
#endif /* BABYSTEP_LOADZ_BY_PLANNER */
|
|
||||||
babystepLoadZ = 0;
|
babystepLoadZ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue