Browse Source

🐛 Trigger existing endstops on G38 hit

Scott Lahteine 4 years ago
parent
commit
500b7872fb
1 changed files with 7 additions and 3 deletions
  1. 7
    3
      Marlin/src/module/endstops.cpp

+ 7
- 3
Marlin/src/module/endstops.cpp View File

@@ -932,9 +932,13 @@ void Endstops::update() {
932 932
     #endif
933 933
     // If G38 command is active check Z_MIN_PROBE for ALL movement
934 934
     if (G38_move && TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE)) != _G38_OPEN_STATE) {
935
-           if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(X_AXIS); }
936
-      else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(Y_AXIS); }
937
-      else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(Z_AXIS); }
935
+           if (stepper.axis_is_moving(X_AXIS)) { _ENDSTOP_HIT(X, TERN(X_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(X_AXIS); }
936
+      #if HAS_Y_AXIS
937
+        else if (stepper.axis_is_moving(Y_AXIS)) { _ENDSTOP_HIT(Y, TERN(Y_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(Y_AXIS); }
938
+      #endif
939
+      #if HAS_Z_AXIS
940
+        else if (stepper.axis_is_moving(Z_AXIS)) { _ENDSTOP_HIT(Z, TERN(Z_HOME_TO_MIN, MIN, MAX)); planner.endstop_triggered(Z_AXIS); }
941
+      #endif
938 942
       G38_did_trigger = true;
939 943
     }
940 944
   #endif

Loading…
Cancel
Save