浏览代码

Move do_probe_raise closer to set_probe_deployed

…and limit the raise to Z_MAX_POS
Scott Lahteine 6 年前
父节点
当前提交
3b4c89e4b5
共有 1 个文件被更改,包括 21 次插入19 次删除
  1. 21
    19
      Marlin/src/module/probe.cpp

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

@@ -57,25 +57,6 @@ float zprobe_zoffset; // Initialized by settings.load()
57 57
   const int z_servo_angle[2] = Z_SERVO_ANGLES;
58 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 60
 #if ENABLED(Z_PROBE_SLED)
80 61
 
81 62
   #ifndef SLED_DOCKING_OFFSET
@@ -353,6 +334,27 @@ inline void do_probe_raise(const float z_raise) {
353 334
 
354 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 358
 // returns false for ok and true for failure
357 359
 bool set_probe_deployed(const bool deploy) {
358 360
 

正在加载...
取消
保存