瀏覽代碼

Move do_probe_raise closer to set_probe_deployed

…and limit the raise to Z_MAX_POS
Scott Lahteine 7 年之前
父節點
當前提交
3b4c89e4b5
共有 1 個檔案被更改,包括 21 行新增19 行删除
  1. 21
    19
      Marlin/src/module/probe.cpp

+ 21
- 19
Marlin/src/module/probe.cpp 查看文件

57
   const int z_servo_angle[2] = Z_SERVO_ANGLES;
57
   const int z_servo_angle[2] = Z_SERVO_ANGLES;
58
 #endif
58
 #endif
59
 
59
 
60
-/**
61
- * Raise Z to a minimum height to make room for a probe to move
62
- */
63
-inline void do_probe_raise(const float z_raise) {
64
-  #if ENABLED(DEBUG_LEVELING_FEATURE)
65
-    if (DEBUGGING(LEVELING)) {
66
-      SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
67
-      SERIAL_CHAR(')');
68
-      SERIAL_EOL();
69
-    }
70
-  #endif
71
-
72
-  float z_dest = z_raise;
73
-  if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset;
74
-
75
-  if (z_dest > current_position[Z_AXIS])
76
-    do_blocking_move_to_z(z_dest);
77
-}
78
-
79
 #if ENABLED(Z_PROBE_SLED)
60
 #if ENABLED(Z_PROBE_SLED)
80
 
61
 
81
   #ifndef SLED_DOCKING_OFFSET
62
   #ifndef SLED_DOCKING_OFFSET
353
 
334
 
354
 #endif // BLTOUCH
335
 #endif // BLTOUCH
355
 
336
 
337
+/**
338
+ * Raise Z to a minimum height to make room for a probe to move
339
+ */
340
+inline void do_probe_raise(const float z_raise) {
341
+  #if ENABLED(DEBUG_LEVELING_FEATURE)
342
+    if (DEBUGGING(LEVELING)) {
343
+      SERIAL_ECHOPAIR("do_probe_raise(", z_raise);
344
+      SERIAL_CHAR(')');
345
+      SERIAL_EOL();
346
+    }
347
+  #endif
348
+
349
+  float z_dest = z_raise;
350
+  if (zprobe_zoffset < 0) z_dest -= zprobe_zoffset;
351
+
352
+  NOMORE(z_dest, Z_MAX_POS);
353
+
354
+  if (z_dest > current_position[Z_AXIS])
355
+    do_blocking_move_to_z(z_dest);
356
+}
357
+
356
 // returns false for ok and true for failure
358
 // returns false for ok and true for failure
357
 bool set_probe_deployed(const bool deploy) {
359
 bool set_probe_deployed(const bool deploy) {
358
 
360
 

Loading…
取消
儲存