|
|
@ -377,9 +377,6 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Save current position to destination, for use later
|
|
|
|
|
|
|
|
set_destination_from_current();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LEVELING
|
|
|
|
#if HAS_LEVELING
|
|
|
|
// Set current position to the physical position
|
|
|
|
// Set current position to the physical position
|
|
|
|
const bool leveling_was_active = planner.leveling_active;
|
|
|
|
const bool leveling_was_active = planner.leveling_active;
|
|
|
@ -388,10 +385,23 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
#if ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS
|
|
|
|
|
|
|
|
// Update the X software endstops early
|
|
|
|
|
|
|
|
active_extruder = tmp_extruder;
|
|
|
|
|
|
|
|
update_software_endstops(X_AXIS);
|
|
|
|
|
|
|
|
active_extruder = !tmp_extruder;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Don't move the new extruder out of bounds
|
|
|
|
|
|
|
|
if (!WITHIN(current_position[X_AXIS], soft_endstop_min[X_AXIS], soft_endstop_max[X_AXIS]))
|
|
|
|
|
|
|
|
no_move = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!no_move) set_destination_from_current();
|
|
|
|
dualx_tool_change(tmp_extruder, no_move); // Can modify no_move
|
|
|
|
dualx_tool_change(tmp_extruder, no_move); // Can modify no_move
|
|
|
|
|
|
|
|
|
|
|
|
#else // !DUAL_X_CARRIAGE
|
|
|
|
#else // !DUAL_X_CARRIAGE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set_destination_from_current();
|
|
|
|
#if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder
|
|
|
|
#if ENABLED(PARKING_EXTRUDER) // Dual Parking extruder
|
|
|
|
parking_extruder_tool_change(tmp_extruder, no_move);
|
|
|
|
parking_extruder_tool_change(tmp_extruder, no_move);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -424,16 +434,16 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
|
|
|
|
|
|
|
|
#endif // !DUAL_X_CARRIAGE
|
|
|
|
#endif // !DUAL_X_CARRIAGE
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LEVELING
|
|
|
|
|
|
|
|
// Restore leveling to re-establish the logical position
|
|
|
|
|
|
|
|
set_bed_leveling_enabled(leveling_was_active);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SWITCHING_NOZZLE)
|
|
|
|
#if ENABLED(SWITCHING_NOZZLE)
|
|
|
|
// The newly-selected extruder Z is actually at...
|
|
|
|
// The newly-selected extruder Z is actually at...
|
|
|
|
current_position[Z_AXIS] -= zdiff;
|
|
|
|
current_position[Z_AXIS] -= zdiff;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LEVELING
|
|
|
|
|
|
|
|
// Restore leveling to re-establish the logical position
|
|
|
|
|
|
|
|
set_bed_leveling_enabled(leveling_was_active);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// Tell the planner the new "current position"
|
|
|
|
// Tell the planner the new "current position"
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC();
|
|
|
|
SYNC_PLAN_POSITION_KINEMATIC();
|
|
|
|
|
|
|
|
|
|
|
@ -477,6 +487,10 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
|
|
|
|
|
|
|
|
|
|
|
feedrate_mm_s = old_feedrate_mm_s;
|
|
|
|
feedrate_mm_s = old_feedrate_mm_s;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SOFTWARE_ENDSTOPS && ENABLED(DUAL_X_CARRIAGE)
|
|
|
|
|
|
|
|
update_software_endstops(X_AXIS);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#else // HOTENDS <= 1
|
|
|
|
#else // HOTENDS <= 1
|
|
|
|
|
|
|
|
|
|
|
|
UNUSED(fr_mm_s);
|
|
|
|
UNUSED(fr_mm_s);
|
|
|
|