Browse Source

Don't raise Z if only homing Z

Scott Lahteine 9 years ago
parent
commit
4036c73cdd
1 changed files with 19 additions and 17 deletions
  1. 19
    17
      Marlin/Marlin_main.cpp

+ 19
- 17
Marlin/Marlin_main.cpp View File

@@ -2914,27 +2914,29 @@ inline void gcode_G28() {
2914 2914
 
2915 2915
     #elif defined(MIN_Z_HEIGHT_FOR_HOMING) && MIN_Z_HEIGHT_FOR_HOMING > 0
2916 2916
 
2917
-      // Raise Z before homing, if specified
2918
-      float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING;
2919
-      if (z_dest > current_position[Z_AXIS]) {
2917
+      // Raise Z before homing X or Y, if specified
2918
+      if (home_all_axis || homeX || homeY) {
2919
+        float z_dest = home_offset[Z_AXIS] + MIN_Z_HEIGHT_FOR_HOMING;
2920
+        if (z_dest > current_position[Z_AXIS]) {
2920 2921
 
2921
-        #if ENABLED(DEBUG_LEVELING_FEATURE)
2922
-          if (DEBUGGING(LEVELING)) {
2923
-            SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest);
2924
-            SERIAL_EOL;
2925
-          }
2926
-        #endif
2922
+          #if ENABLED(DEBUG_LEVELING_FEATURE)
2923
+            if (DEBUGGING(LEVELING)) {
2924
+              SERIAL_ECHOPAIR("Raise Z (before homing) to ", z_dest);
2925
+              SERIAL_EOL;
2926
+            }
2927
+          #endif
2927 2928
 
2928
-        feedrate = homing_feedrate[Z_AXIS];
2929
+          feedrate = homing_feedrate[Z_AXIS];
2929 2930
 
2930
-        #if HAS_BED_PROBE
2931
-          do_blocking_move_to_z(z_dest);
2932
-        #else
2933
-          line_to_z(z_dest);
2934
-          stepper.synchronize();
2935
-        #endif
2931
+          #if HAS_BED_PROBE
2932
+            do_blocking_move_to_z(z_dest);
2933
+          #else
2934
+            line_to_z(z_dest);
2935
+            stepper.synchronize();
2936
+          #endif
2936 2937
 
2937
-        destination[Z_AXIS] = current_position[Z_AXIS] = z_dest;
2938
+          destination[Z_AXIS] = current_position[Z_AXIS] = z_dest;
2939
+        }
2938 2940
       }
2939 2941
 
2940 2942
     #endif // MIN_Z_HEIGHT_FOR_HOMING

Loading…
Cancel
Save