Browse Source

Use "Tn S1" to change tools without moving

Scott Lahteine 8 years ago
parent
commit
7fb69e24fb
1 changed files with 4 additions and 2 deletions
  1. 4
    2
      Marlin/Marlin_main.cpp

+ 4
- 2
Marlin/Marlin_main.cpp View File

6587
  * T0-T3: Switch tool, usually switching extruders
6587
  * T0-T3: Switch tool, usually switching extruders
6588
  *
6588
  *
6589
  *   F[mm/min] Set the movement feedrate
6589
  *   F[mm/min] Set the movement feedrate
6590
+ *   S1        Don't move the tool in XY after change
6590
  */
6591
  */
6591
 inline void gcode_T(uint8_t tmp_extruder) {
6592
 inline void gcode_T(uint8_t tmp_extruder) {
6592
   if (tmp_extruder >= EXTRUDERS) {
6593
   if (tmp_extruder >= EXTRUDERS) {
6613
 
6614
 
6614
   #if HOTENDS > 1
6615
   #if HOTENDS > 1
6615
     if (tmp_extruder != active_extruder) {
6616
     if (tmp_extruder != active_extruder) {
6617
+      bool no_move = code_seen('S') && code_value_bool();
6616
       // Save current position to return to after applying extruder offset
6618
       // Save current position to return to after applying extruder offset
6617
-      set_destination_to_current();
6619
+      if (!no_move) set_destination_to_current();
6618
       #if ENABLED(DUAL_X_CARRIAGE)
6620
       #if ENABLED(DUAL_X_CARRIAGE)
6619
         if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
6621
         if (dual_x_carriage_mode == DXC_AUTO_PARK_MODE && IsRunning() &&
6620
             (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) {
6622
             (delayed_move_time || current_position[X_AXIS] != x_home_pos(active_extruder))) {
6717
       #endif
6719
       #endif
6718
 
6720
 
6719
       // Move to the "old position" (move the extruder into place)
6721
       // Move to the "old position" (move the extruder into place)
6720
-      if (IsRunning()) prepare_move_to_destination();
6722
+      if (!no_move && IsRunning()) prepare_move_to_destination();
6721
 
6723
 
6722
     } // (tmp_extruder != active_extruder)
6724
     } // (tmp_extruder != active_extruder)
6723
 
6725
 

Loading…
Cancel
Save