Browse Source

Merge pull request #4013 from thinkyhead/rc_toolchange_no_move

Use "Tn S1" to change tools without moving
Scott Lahteine 8 years ago
parent
commit
52ac2a62ee
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      Marlin/Marlin_main.cpp

+ 4
- 2
Marlin/Marlin_main.cpp View File

@@ -6613,6 +6613,7 @@ inline void gcode_M999() {
6613 6613
  * T0-T3: Switch tool, usually switching extruders
6614 6614
  *
6615 6615
  *   F[mm/min] Set the movement feedrate
6616
+ *   S1        Don't move the tool in XY after change
6616 6617
  */
6617 6618
 inline void gcode_T(uint8_t tmp_extruder) {
6618 6619
   if (tmp_extruder >= EXTRUDERS) {
@@ -6639,8 +6640,9 @@ inline void gcode_T(uint8_t tmp_extruder) {
6639 6640
 
6640 6641
   #if HOTENDS > 1
6641 6642
     if (tmp_extruder != active_extruder) {
6643
+      bool no_move = code_seen('S') && code_value_bool();
6642 6644
       // Save current position to return to after applying extruder offset
6643
-      set_destination_to_current();
6645
+      if (!no_move) set_destination_to_current();
6644 6646
       #if ENABLED(DUAL_X_CARRIAGE)
6645 6647
         if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
6646 6648
             (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) {
@@ -6744,7 +6746,7 @@ inline void gcode_T(uint8_t tmp_extruder) {
6744 6746
       #endif
6745 6747
 
6746 6748
       // Move to the "old position" (move the extruder into place)
6747
-      if (IsRunning()) prepare_move_to_destination();
6749
+      if (!no_move && IsRunning()) prepare_move_to_destination();
6748 6750
 
6749 6751
     } // (tmp_extruder != active_extruder)
6750 6752
 

Loading…
Cancel
Save