Add M851 X Y probe offsets (#15202)
This commit is contained in:
committed by
Scott Lahteine
parent
ebc9a8a0b0
commit
df1e51258a
@ -708,7 +708,7 @@ namespace ExtUI {
|
||||
#if EXTRUDERS > 1
|
||||
&& (linked_nozzles || active_extruder == 0)
|
||||
#endif
|
||||
) zprobe_zoffset += mm;
|
||||
) zprobe_offset[Z_AXIS] += mm;
|
||||
#else
|
||||
UNUSED(mm);
|
||||
#endif
|
||||
@ -746,7 +746,7 @@ namespace ExtUI {
|
||||
|
||||
float getZOffset_mm() {
|
||||
#if HAS_BED_PROBE
|
||||
return zprobe_zoffset;
|
||||
return zprobe_offset[Z_AXIS];
|
||||
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
return babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1];
|
||||
#else
|
||||
@ -757,7 +757,7 @@ namespace ExtUI {
|
||||
void setZOffset_mm(const float value) {
|
||||
#if HAS_BED_PROBE
|
||||
if (WITHIN(value, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX))
|
||||
zprobe_zoffset = value;
|
||||
zprobe_offset[Z_AXIS] = value;
|
||||
#elif ENABLED(BABYSTEP_DISPLAY_TOTAL)
|
||||
babystep.add_mm(Z_AXIS, (value - babystep.axis_total[BS_TOTAL_AXIS(Z_AXIS) + 1]));
|
||||
#else
|
||||
|
@ -402,7 +402,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
ui.encoderPosition = 0;
|
||||
|
||||
const float diff = planner.steps_to_mm[Z_AXIS] * babystep_increment,
|
||||
new_probe_offset = zprobe_zoffset + diff,
|
||||
new_probe_offset = zprobe_offset[Z_AXIS] + diff,
|
||||
new_offs =
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
do_probe ? new_probe_offset : hotend_offset[Z_AXIS][active_extruder] - diff
|
||||
@ -414,7 +414,7 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
|
||||
babystep.add_steps(Z_AXIS, babystep_increment);
|
||||
|
||||
if (do_probe) zprobe_zoffset = new_offs;
|
||||
if (do_probe) zprobe_offset[Z_AXIS] = new_offs;
|
||||
#if ENABLED(BABYSTEP_HOTEND_Z_OFFSET)
|
||||
else hotend_offset[Z_AXIS][active_extruder] = new_offs;
|
||||
#endif
|
||||
@ -428,10 +428,10 @@ void scroll_screen(const uint8_t limit, const bool is_menu) {
|
||||
draw_edit_screen(PSTR(MSG_Z_OFFSET), ftostr43sign(hotend_offset[Z_AXIS][active_extruder]));
|
||||
else
|
||||
#endif
|
||||
draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_zoffset));
|
||||
draw_edit_screen(PSTR(MSG_ZPROBE_ZOFFSET), ftostr43sign(zprobe_offset[Z_AXIS]));
|
||||
|
||||
#if ENABLED(BABYSTEP_ZPROBE_GFX_OVERLAY)
|
||||
if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_zoffset);
|
||||
if (do_probe) _lcd_zoffset_overlay_gfx(zprobe_offset[Z_AXIS]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -62,10 +62,10 @@ static inline void _lcd_goto_next_corner() {
|
||||
current_position[Y_AXIS] = Y_MIN_BED + LEVEL_CORNERS_INSET;
|
||||
break;
|
||||
case 1:
|
||||
current_position[X_AXIS] = X_MAX_BED - LEVEL_CORNERS_INSET;
|
||||
current_position[X_AXIS] = X_MAX_BED - (LEVEL_CORNERS_INSET);
|
||||
break;
|
||||
case 2:
|
||||
current_position[Y_AXIS] = Y_MAX_BED - LEVEL_CORNERS_INSET;
|
||||
current_position[Y_AXIS] = Y_MAX_BED - (LEVEL_CORNERS_INSET);
|
||||
break;
|
||||
case 3:
|
||||
current_position[X_AXIS] = X_MIN_BED + LEVEL_CORNERS_INSET;
|
||||
|
@ -279,7 +279,7 @@ void menu_bed_leveling() {
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||
#elif HAS_BED_PROBE
|
||||
MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
#endif
|
||||
|
||||
#if ENABLED(LEVEL_BED_CORNERS)
|
||||
|
@ -347,7 +347,7 @@ void menu_configuration() {
|
||||
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
||||
MENU_ITEM(submenu, MSG_ZPROBE_ZOFFSET, lcd_babystep_zoffset);
|
||||
#elif HAS_BED_PROBE
|
||||
MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
MENU_ITEM_EDIT(float52, MSG_ZPROBE_ZOFFSET, &zprobe_offset[Z_AXIS], Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
|
||||
#endif
|
||||
|
||||
const bool busy = printer_busy();
|
||||
|
Reference in New Issue
Block a user