Browse Source

Fix SWITCHING_NOZZLE compile error (#11657)

pull/1/head
scott0122 6 years ago
committed by Scott Lahteine
parent
commit
6dc9553aa5
  1. 11
      Marlin/src/module/tool_change.cpp

11
Marlin/src/module/tool_change.cpp

@ -403,18 +403,17 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
parking_extruder_tool_change(tmp_extruder, no_move);
#endif
const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],
ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder],
zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder];
#if ENABLED(SWITCHING_NOZZLE)
// Always raise by at least 1 to avoid workpiece
const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1;
current_position[Z_AXIS] += (zdiff < 0.0 ? -zdiff : 0.0) + 1;
planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
move_nozzle_servo(tmp_extruder);
#endif
const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],
ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder],
zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder];
#if ENABLED(DEBUG_LEVELING_FEATURE)
if (DEBUGGING(LEVELING)) {
SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff);

Loading…
Cancel
Save