4141
4242void _goto_manual_move_z (const_float_t );
4343
44- // Global storage
44+ // Global storage - TODO: Keep wizard/process data in a 'ui.scratch' union.
4545float z_offset_backup, calculated_z_offset, z_offset_ref;
4646
47+ // "Done" - Set the offset, re-enable leveling, go back to the previous screen.
4748void set_offset_and_go_back (const_float_t z) {
4849 probe.offset .z = z;
4950 SET_SOFT_ENDSTOP_LOOSE (false );
5051 TERN_ (HAS_LEVELING, set_bed_leveling_enabled (menu_leveling_was_active));
5152 ui.goto_previous_screen_no_defer ();
5253}
5354
55+ /* *
56+ * @fn probe_offset_wizard_menu
57+ * @brief Display a menu to Move Z, Cancel, or signal Done
58+ */
5459void probe_offset_wizard_menu () {
5560 START_MENU ();
5661 calculated_z_offset = probe.offset .z + current_position.z - z_offset_ref;
@@ -88,6 +93,16 @@ void probe_offset_wizard_menu() {
8893 END_MENU ();
8994}
9095
96+ /* *
97+ * @fn prepare_for_probe_offset_wizard
98+ * @brief Prepare the Probe Offset Wizard to do user interaction.
99+ * @description
100+ * 1. Probe a defined point (or the center) for an initial Probe Reference Z (relative to the homed Z0).
101+ * (When homing with the probe, this Z0 is suspect until 'M851 Z' is properly tuned.
102+ * When homing with a Z endstop Z0 is suspect until M206 is properly tuned.)
103+ * 2. Stow the probe and move the nozzle over the probed point.
104+ * 3. Go to the probe_offset_wizard_menu() screen for Z position adjustment to acquire Z0.
105+ */
91106void prepare_for_probe_offset_wizard () {
92107 #if defined(PROBE_OFFSET_WIZARD_XY_POS) || !HOMING_Z_WITH_PROBE
93108 if (ui.should_draw ()) MenuItem_static::draw (1 , GET_TEXT_F (MSG_PROBE_WIZARD_PROBING));
@@ -126,6 +141,8 @@ void prepare_for_probe_offset_wizard() {
126141 ui.defer_status_screen ();
127142}
128143
144+ // Set up the wizard, initiate homing with "Homing XYZ" message.
145+ // When homing is completed go to prepare_for_probe_offset_wizard().
129146void goto_probe_offset_wizard () {
130147 ui.defer_status_screen ();
131148 set_all_unhomed ();
@@ -146,6 +163,7 @@ void goto_probe_offset_wizard() {
146163 // Home all axes
147164 queue.inject_P (G28_STR);
148165
166+ // Show "Homing XYZ" display until homing completes
149167 ui.goto_screen ([]{
150168 _lcd_draw_homing ();
151169 if (all_axes_homed ()) {
0 commit comments