Browse Source

Fix SWITCHING_NOZZLE compile error (#11657)

scott0122 7 years ago
parent
commit
6dc9553aa5
1 changed files with 5 additions and 6 deletions
  1. 5
    6
      Marlin/src/module/tool_change.cpp

+ 5
- 6
Marlin/src/module/tool_change.cpp View File

403
             parking_extruder_tool_change(tmp_extruder, no_move);
403
             parking_extruder_tool_change(tmp_extruder, no_move);
404
           #endif
404
           #endif
405
 
405
 
406
+          const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],
407
+                      ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder],
408
+                      zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder];
409
+
406
           #if ENABLED(SWITCHING_NOZZLE)
410
           #if ENABLED(SWITCHING_NOZZLE)
407
             // Always raise by at least 1 to avoid workpiece
411
             // Always raise by at least 1 to avoid workpiece
408
-            const float zdiff = hotend_offset[Z_AXIS][active_extruder] - hotend_offset[Z_AXIS][tmp_extruder];
409
-            current_position[Z_AXIS] += (zdiff > 0.0 ? zdiff : 0.0) + 1;
412
+            current_position[Z_AXIS] += (zdiff < 0.0 ? -zdiff : 0.0) + 1;
410
             planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
413
             planner.buffer_line_kinematic(current_position, planner.max_feedrate_mm_s[Z_AXIS], active_extruder);
411
             move_nozzle_servo(tmp_extruder);
414
             move_nozzle_servo(tmp_extruder);
412
           #endif
415
           #endif
413
 
416
 
414
-          const float xdiff = hotend_offset[X_AXIS][tmp_extruder] - hotend_offset[X_AXIS][active_extruder],
415
-                      ydiff = hotend_offset[Y_AXIS][tmp_extruder] - hotend_offset[Y_AXIS][active_extruder],
416
-                      zdiff = hotend_offset[Z_AXIS][tmp_extruder] - hotend_offset[Z_AXIS][active_extruder];
417
-
418
           #if ENABLED(DEBUG_LEVELING_FEATURE)
417
           #if ENABLED(DEBUG_LEVELING_FEATURE)
419
             if (DEBUGGING(LEVELING)) {
418
             if (DEBUGGING(LEVELING)) {
420
               SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff);
419
               SERIAL_ECHOPAIR("Offset Tool XY by { ", xdiff);

Loading…
Cancel
Save