Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "Tn S1" to change tools without moving #4013

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Marlin/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6587,6 +6587,7 @@ inline void gcode_M999() {
* T0-T3: Switch tool, usually switching extruders
*
* F[mm/min] Set the movement feedrate
* S1 Don't move the tool in XY after change
*/
inline void gcode_T(uint8_t tmp_extruder) {
if (tmp_extruder >= EXTRUDERS) {
Expand All @@ -6613,8 +6614,9 @@ inline void gcode_T(uint8_t tmp_extruder) {

#if HOTENDS > 1
if (tmp_extruder != active_extruder) {
bool no_move = code_seen('S') && code_value_bool();
// Save current position to return to after applying extruder offset
set_destination_to_current();
if (!no_move) set_destination_to_current();
#if ENABLED(DUAL_X_CARRIAGE)
if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
(delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) {
Expand Down Expand Up @@ -6717,7 +6719,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
#endif

// Move to the "old position" (move the extruder into place)
if (IsRunning()) prepare_move_to_destination();
if (!no_move && IsRunning()) prepare_move_to_destination();

} // (tmp_extruder != active_extruder)

Expand Down