Skip to content

Commit ec8b2c7

Browse files
mwinters-stuffkpishere
authored andcommitted
Z Probe Offset Wizard (MarlinFirmware#18866)
1 parent 7f991ce commit ec8b2c7

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Marlin/Configuration_adv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@
10731073

10741074
#if HAS_LCD_MENU
10751075

1076-
// Add Probe Z Offset calibration to the Z Probe Offsets menu
1076+
// Add Probe Z Offset calibration to the Bed Leveling menu
10771077
#if HAS_BED_PROBE
10781078
//#define PROBE_OFFSET_WIZARD
10791079
#if ENABLED(PROBE_OFFSET_WIZARD)

Marlin/src/lcd/menu/menu_bed_leveling.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ void menu_bed_leveling() {
283283
EDIT_ITEM(LCD_Z_OFFSET_TYPE, MSG_ZPROBE_ZOFFSET, &probe.offset.z, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX);
284284
#endif
285285

286+
#if ENABLED(PROBE_OFFSET_WIZARD)
287+
SUBMENU(MSG_PROBE_WIZARD, goto_probe_offset_wizard);
288+
#endif
289+
286290
#if ENABLED(LEVEL_BED_CORNERS)
287291
SUBMENU(MSG_LEVEL_CORNERS, _lcd_level_bed_corners);
288292
#endif

Marlin/src/lcd/menu/menu_probe_offset.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,16 @@
4848
float z_offset_backup, calculated_z_offset;
4949

5050
TERN_(HAS_LEVELING, bool leveling_was_active);
51+
TERN_(HAS_SOFTWARE_ENDSTOPS, bool store_soft_endstops_enabled);
5152

5253
void prepare_for_calibration() {
5354
z_offset_backup = probe.offset.z;
5455

5556
// Disable soft endstops for free Z movement
56-
SET_SOFT_ENDSTOP_LOOSE(true);
57+
#if HAS_SOFTWARE_ENDSTOPS
58+
store_soft_endstops_enabled = soft_endstops_enabled;
59+
soft_endstops_enabled = false;
60+
#endif
5761

5862
// Disable leveling for raw planner motion
5963
#if HAS_LEVELING
@@ -64,7 +68,7 @@ void prepare_for_calibration() {
6468

6569
void set_offset_and_go_back(const float &z) {
6670
probe.offset.z = z;
67-
SET_SOFT_ENDSTOP_LOOSE(false);
71+
TERN_(HAS_SOFTWARE_ENDSTOPS, soft_endstops_enabled = store_soft_endstops_enabled);
6872
TERN_(HAS_LEVELING, set_bed_leveling_enabled(leveling_was_active));
6973
ui.goto_previous_screen_no_defer();
7074
}
@@ -90,7 +94,7 @@ void probe_offset_wizard_menu() {
9094
if ((SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
9195
extern const char NUL_STR[];
9296
SUBMENU_P(NUL_STR, []{ _goto_manual_move_z(float(SHORT_MANUAL_Z_MOVE)); });
93-
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
97+
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_CHARACTER_LCD));
9498
char tmp[20], numstr[10];
9599
// Determine digits needed right of decimal
96100
const uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :

0 commit comments

Comments
 (0)