Browse Source

Tweak how homeaxis deploys and stows

Scott Lahteine 10 years ago
parent
commit
ce3caf447b
1 changed files with 23 additions and 13 deletions
  1. 23
    13
      Marlin/Marlin_main.cpp

+ 23
- 13
Marlin/Marlin_main.cpp View File

@@ -1528,14 +1528,19 @@ static void homeaxis(AxisEnum axis) {
1528 1528
     #if SERVO_LEVELING && !defined(Z_PROBE_SLED)
1529 1529
 
1530 1530
       // Deploy a probe if there is one, and homing towards the bed
1531
-      if (axis == Z_AXIS && axis_home_dir < 0) deploy_z_probe();
1532
-
1533
-    #elif defined(SERVO_ENDSTOPS)
1531
+      if (axis == Z_AXIS) {
1532
+        if (axis_home_dir < 0) deploy_z_probe();
1533
+      }
1534
+      else
1534 1535
 
1535
-      // Engage Servo endstop if enabled
1536
-      if (servo_endstops[axis] > -1)
1537
-        servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
1536
+    #endif
1538 1537
 
1538
+    #ifdef SERVO_ENDSTOPS
1539
+      {
1540
+        // Engage Servo endstop if enabled
1541
+        if (servo_endstops[axis] > -1)
1542
+          servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
1543
+      }
1539 1544
     #endif
1540 1545
 
1541 1546
     // Set a flag for Z motor locking
@@ -1618,15 +1623,20 @@ static void homeaxis(AxisEnum axis) {
1618 1623
 
1619 1624
     #if SERVO_LEVELING && !defined(Z_PROBE_SLED)
1620 1625
 
1621
-      // Stow the Z probe if it had been deployed
1622
-      if (axis == Z_AXIS && axis_home_dir < 0) stow_z_probe();
1623
-
1624
-    #elif defined(SERVO_ENDSTOPS)
1626
+      // Deploy a probe if there is one, and homing towards the bed
1627
+      if (axis == Z_AXIS) {
1628
+        if (axis_home_dir < 0) stow_z_probe();
1629
+      }
1630
+      else
1625 1631
 
1626
-      // Retract Servo endstop if enabled
1627
-      if (servo_endstops[axis] > -1)
1628
-        servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
1632
+    #endif
1629 1633
 
1634
+    #ifdef SERVO_ENDSTOPS
1635
+      {
1636
+        // Retract Servo endstop if enabled
1637
+        if (servo_endstops[axis] > -1)
1638
+          servo[servo_endstops[axis]].write(servo_endstop_angles[axis * 2 + 1]);
1639
+      }
1630 1640
     #endif
1631 1641
 
1632 1642
   }

Loading…
Cancel
Save