Skip to content

Commit

Permalink
use a goto
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Jul 19, 2022
1 parent 089e17a commit cd6d1b4
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Marlin/src/gcode/probe/G30.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ void GcodeSuite::G30() {
SERIAL_ECHOLNF(GET_EN_TEXT_F(MSG_ZPROBE_OUT));
LCD_MESSAGE(MSG_ZPROBE_OUT);
#endif
// Restore the active tool after aborting
#if HAS_MULTI_HOTEND
tool_change(old_tool_index); // Do move if one of these
#endif
return;
goto EXIT_G30;
}

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

// Restore the active tool after probing
#if HAS_MULTI_HOTEND
tool_change(old_tool_index); // Do move if one of these
#endif
EXIT_G30:

// Restore the active tool
TERN_(HAS_MULTI_HOTEND, tool_change(old_tool_index));

report_current_position();
}
Expand Down

0 comments on commit cd6d1b4

Please sign in to comment.