瀏覽代碼

Format probe stowed test code

Scott Lahteine 8 年之前
父節點
當前提交
a00783c41f
共有 1 個檔案被更改,包括 27 行新增19 行删除
  1. 27
    19
      Marlin/Marlin_main.cpp

+ 27
- 19
Marlin/Marlin_main.cpp 查看文件

@@ -2063,30 +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
-      if(!deploy) endstops.enable_z_probe( deploy ); // Switch off triggered when stowed probes early
2072
-                                                     // Else a Allen-Key probe can't be stowed.
2073
-    #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.
2074 2072
 
2075
-    #if ENABLED(Z_PROBE_SLED)
2076
-      dock_sled(!deploy);
2077
-    #elif HAS_Z_SERVO_ENDSTOP
2078
-      servo[Z_ENDSTOP_SERVO_NR].move(z_servo_angle[((deploy) ? 0 : 1)]);
2079
-    #elif ENABLED(Z_PROBE_ALLEN_KEY)
2080
-      if (!deploy) run_stow_moves_script();
2081
-      else run_deploy_moves_script();
2082
-     #else
2083
-      // 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.
2084 2075
     #endif
2085 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
+
2086 2091
     #ifdef _TRIGGERED_WHEN_STOWED_TEST
2087
-      }; // opened before the probe specific actions
2092
+      } // _TRIGGERED_WHEN_STOWED_TEST == deploy
2093
+
2094
+      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) { // State hasn't changed?
2088 2095
 
2089
-      if (_TRIGGERED_WHEN_STOWED_TEST == deploy) {
2090 2096
         if (IsRunning()) {
2091 2097
           SERIAL_ERROR_START;
2092 2098
           SERIAL_ERRORLNPGM("Z-Probe failed");
@@ -2094,7 +2100,9 @@ static void clean_up_after_endstop_or_probe_move() {
2094 2100
         }
2095 2101
         stop();
2096 2102
         return true;
2097
-      }
2103
+
2104
+      } // _TRIGGERED_WHEN_STOWED_TEST == deploy
2105
+
2098 2106
     #endif
2099 2107
 
2100 2108
     do_blocking_move_to(oldXpos, oldYpos, current_position[Z_AXIS]); // return to position before deploy

Loading…
取消
儲存