Kaynağa Gözat

Apply zprobe_zoffset in axis_is_at_home

Ensure the probe offset will always be included when homing Z.
Scott Lahteine 10 yıl önce
ebeveyn
işleme
0165560333
1 değiştirilmiş dosya ile 4 ekleme ve 4 silme
  1. 4
    4
      Marlin/Marlin_main.cpp

+ 4
- 4
Marlin/Marlin_main.cpp Dosyayı Görüntüle

@@ -1034,6 +1034,10 @@ static void axis_is_at_home(int axis) {
1034 1034
     min_pos[axis] = base_min_pos(axis) + home_offset[axis];
1035 1035
     max_pos[axis] = base_max_pos(axis) + home_offset[axis];
1036 1036
   #endif
1037
+
1038
+  #if defined(ENABLE_AUTO_BED_LEVELING) && Z_HOME_DIR < 0
1039
+    if (axis == Z_AXIS) current_position[Z_AXIS] += zprobe_zoffset;
1040
+  #endif
1037 1041
 }
1038 1042
 
1039 1043
 /**
@@ -2042,10 +2046,6 @@ inline void gcode_G28() {
2042 2046
     if (code_seen(axis_codes[Z_AXIS]) && code_has_value())
2043 2047
       current_position[Z_AXIS] = code_value();
2044 2048
 
2045
-    #if defined(ENABLE_AUTO_BED_LEVELING) && (Z_HOME_DIR < 0)
2046
-      if (home_all_axis || homeZ) current_position[Z_AXIS] += zprobe_zoffset;  // Add Z_Probe offset (the distance is negative)
2047
-    #endif
2048
-
2049 2049
     sync_plan_position();
2050 2050
 
2051 2051
   #endif // else DELTA

Loading…
İptal
Kaydet