Option to set manual Babystepping distance in mm (#18503)
Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
@ -343,7 +343,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
ui.defer_status_screen();
|
||||
const bool do_probe = DISABLED(BABYSTEP_HOTEND_Z_OFFSET) || active_extruder == 0;
|
||||
if (ui.encoderPosition) {
|
||||
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_MULTIPLICATOR_Z);
|
||||
const int16_t babystep_increment = int16_t(ui.encoderPosition) * (BABYSTEP_SIZE_Z);
|
||||
ui.encoderPosition = 0;
|
||||
|
||||
const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
|
||||
|
@ -587,6 +587,17 @@ void _lcd_draw_homing();
|
||||
#else
|
||||
void lcd_babystep_z();
|
||||
#endif
|
||||
|
||||
#if ENABLED(BABYSTEP_MILLIMETER_UNITS)
|
||||
#define BABYSTEP_SIZE_X int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[X_AXIS])
|
||||
#define BABYSTEP_SIZE_Y int32_t((BABYSTEP_MULTIPLICATOR_XY) * planner.settings.axis_steps_per_mm[Y_AXIS])
|
||||
#define BABYSTEP_SIZE_Z int32_t((BABYSTEP_MULTIPLICATOR_Z) * planner.settings.axis_steps_per_mm[Z_AXIS])
|
||||
#else
|
||||
#define BABYSTEP_SIZE_X BABYSTEP_MULTIPLICATOR_XY
|
||||
#define BABYSTEP_SIZE_Y BABYSTEP_MULTIPLICATOR_XY
|
||||
#define BABYSTEP_SIZE_Z BABYSTEP_MULTIPLICATOR_Z
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(POWER_LOSS_RECOVERY)
|
||||
|
@ -55,9 +55,10 @@
|
||||
if (ui.encoderPosition) {
|
||||
const int16_t steps = int16_t(ui.encoderPosition) * (
|
||||
#if ENABLED(BABYSTEP_XY)
|
||||
axis != Z_AXIS ? BABYSTEP_MULTIPLICATOR_XY :
|
||||
axis == X_AXIS ? BABYSTEP_SIZE_X :
|
||||
axis == Y_AXIS ? BABYSTEP_SIZE_Y :
|
||||
#endif
|
||||
BABYSTEP_MULTIPLICATOR_Z
|
||||
BABYSTEP_SIZE_Z
|
||||
);
|
||||
ui.encoderPosition = 0;
|
||||
ui.refresh(LCDVIEW_REDRAW_NOW);
|
||||
|
Reference in New Issue
Block a user