Sfoglia il codice sorgente

Merge pull request #4551 from thinkyhead/rc_anhardt_rep_stow_allen

Make Allen Key Probe stow
Scott Lahteine 8 anni fa
parent
commit
7145bd085d
1 ha cambiato i file con 27 aggiunte e 17 eliminazioni
  1. 27
    17
      Marlin/Marlin_main.cpp

+ 27
- 17
Marlin/Marlin_main.cpp Vedi File

@@ -2063,28 +2063,36 @@ static void clean_up_after_endstop_or_probe_move() {
2063 2063
     float oldYpos = current_position[Y_AXIS]; // save y position
2064 2064
 
2065 2065
     #ifdef _TRIGGERED_WHEN_STOWED_TEST
2066
+
2066 2067
       // If endstop is already false, the Z probe is deployed
2067
-      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // closed after the probe specific actions.
2068
-                                                   // Would a goto be less ugly?
2069
-      //while (!_TRIGGERED_WHEN_STOWED_TEST) { idle(); // would offer the opportunity
2070
-      // for a triggered when stowed manual probe.
2071
-    #endif
2068
+      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {     // closed after the probe specific actions.
2069
+                                                       // Would a goto be less ugly?
2070
+        //while (!_TRIGGERED_WHEN_STOWED_TEST) idle(); // would offer the opportunity
2071
+                                                       // for a triggered when stowed manual probe.
2072 2072
 
2073
-    #if ENABLED(Z_PROBE_SLED)
2074
-      dock_sled(!deploy);
2075
-    #elif HAS_Z_SERVO_ENDSTOP
2076
-      servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]);
2077
-    #elif ENABLED(Z_PROBE_ALLEN_KEY)
2078
-      if (!deploy) run_stow_moves_script();
2079
-      else run_deploy_moves_script();
2080
-     #else
2081
-      // Nothing to be done. Just enable_z_probe below...
2073
+        if (!deploy) endstops.enable_z_probe(false); // Switch off triggered when stowed probes early
2074
+                                                     // otherwise an Allen-Key probe can't be stowed.
2082 2075
     #endif
2083 2076
 
2077
+        #if ENABLED(Z_PROBE_SLED)
2078
+
2079
+          dock_sled(!deploy);
2080
+
2081
+        #elif HAS_Z_SERVO_ENDSTOP
2082
+
2083
+          servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[deploy ? 0 : 1]);
2084
+
2085
+        #elif ENABLED(Z_PROBE_ALLEN_KEY)
2086
+
2087
+          deploy ? run_deploy_moves_script() : run_stow_moves_script();
2088
+
2089
+        #endif
2090
+
2084 2091
     #ifdef _TRIGGERED_WHEN_STOWED_TEST
2085
-      }; // opened before the probe specific actions
2092
+      } // _TRIGGERED_WHEN_STOWED_TEST == deploy
2093
+
2094
+      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed?
2086 2095
 
2087
-      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {
2088 2096
         if (IsRunning()) {
2089 2097
           SERIAL_ERROR_START;
2090 2098
           SERIAL_ERRORLNPGM("Z-Probe failed");
@@ -2092,7 +2100,9 @@ static void clean_up_after_endstop_or_probe_move() {
2092 2100
         }
2093 2101
         stop();
2094 2102
         return true;
2095
-      }
2103
+
2104
+      } // _TRIGGERED_WHEN_STOWED_TEST == deploy
2105
+
2096 2106
     #endif
2097 2107
 
2098 2108
     do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy

Loading…
Annulla
Salva