Skip to content

Commit cd6d1b4

Browse files
committed
use a goto
1 parent 089e17a commit cd6d1b4

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Marlin/src/gcode/probe/G30.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,7 @@ void GcodeSuite::G30() {
6666
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
6767
LCD_MESSAGE(MSG_ZPROBE_OUT);
6868
#endif
69-
// Restore the active tool after aborting
70-
#if HAS_MULTI_HOTEND
71-
tool_change(old_tool_index); // Do move if one of these
72-
#endif
73-
return;
69+
goto EXIT_G30;
7470
}
7571

7672
// Disable leveling so the planner won't mess with us
@@ -103,10 +99,10 @@ void GcodeSuite::G30() {
10399
if (raise_after == PROBE_PT_STOW)
104100
probe.move_z_after_probing();
105101

106-
// Restore the active tool after probing
107-
#if HAS_MULTI_HOTEND
108-
tool_change(old_tool_index); // Do move if one of these
109-
#endif
102+
EXIT_G30:
103+
104+
// Restore the active tool
105+
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));
110106

111107
report_current_position();
112108
}

0 commit comments

Comments
 (0)