Browse Source

[2.0.x] bltouch home refinements (#11397)

Just create  a better functions call logic flow
Giuliano 6 years ago
parent
commit
74900f7a70
1 changed files with 13 additions and 12 deletions
  1. 13
    12
      Marlin/src/module/motion.cpp

+ 13
- 12
Marlin/src/module/motion.cpp View File

@@ -1297,12 +1297,7 @@ void homeaxis(const AxisEnum axis) {
1297 1297
 
1298 1298
   // Homing Z towards the bed? Deploy the Z probe or endstop.
1299 1299
   #if HOMING_Z_WITH_PROBE
1300
-    if (axis == Z_AXIS) {
1301
-      if (DEPLOY_PROBE()) return;
1302
-      #if ENABLED(BLTOUCH)
1303
-        if (set_bltouch_deployed(true)) return;
1304
-      #endif
1305
-    }
1300
+    if (axis == Z_AXIS && DEPLOY_PROBE()) return;
1306 1301
   #endif
1307 1302
 
1308 1303
   // Set flags for X, Y, Z motor locking
@@ -1326,6 +1321,12 @@ void homeaxis(const AxisEnum axis) {
1326 1321
   #if ENABLED(DEBUG_LEVELING_FEATURE)
1327 1322
     if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("Home 1 Fast:");
1328 1323
   #endif
1324
+
1325
+  #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
1326
+    // BLTOUCH needs to be deployed every time
1327
+    if (axis == Z_AXIS && set_bltouch_deployed(true)) return;
1328
+  #endif
1329
+
1329 1330
   do_homing_move(axis, 1.5f * max_length(axis) * axis_home_dir);
1330 1331
 
1331 1332
   #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
@@ -1364,6 +1365,11 @@ void homeaxis(const AxisEnum axis) {
1364 1365
     #endif
1365 1366
 
1366 1367
     do_homing_move(axis, 2 * bump, get_homing_bump_feedrate(axis));
1368
+
1369
+    #if HOMING_Z_WITH_PROBE && ENABLED(BLTOUCH)
1370
+      // BLTOUCH needs to be stowed after trigger to rearm itself
1371
+      if (axis == Z_AXIS) set_bltouch_deployed(false);
1372
+    #endif
1367 1373
   }
1368 1374
 
1369 1375
   #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS)
@@ -1440,12 +1446,7 @@ void homeaxis(const AxisEnum axis) {
1440 1446
 
1441 1447
   // Put away the Z probe
1442 1448
   #if HOMING_Z_WITH_PROBE
1443
-    if (axis == Z_AXIS) {
1444
-      #if ENABLED(BLTOUCH)
1445
-        if (set_bltouch_deployed(false)) return;
1446
-      #endif
1447
-      if (STOW_PROBE()) return;
1448
-    }
1449
+    if (axis == Z_AXIS && STOW_PROBE()) return;
1449 1450
   #endif
1450 1451
 
1451 1452
   // Clear retracted status if homing the Z axis

Loading…
Cancel
Save