Browse Source

Raise when not retracting

Code to raise the probe before retraction is good, but the code should
always raise the probe, not just when retracting
Scott Lahteine 10 years ago
parent
commit
9a5a7a3f68
1 changed files with 11 additions and 6 deletions
  1. 11
    6
      Marlin/Marlin_main.cpp

+ 11
- 6
Marlin/Marlin_main.cpp View File

1254
 
1254
 
1255
   }
1255
   }
1256
 
1256
 
1257
-  static void retract_z_probe(const float z_after=Z_RAISE_AFTER_PROBING) {
1257
+  static void retract_z_probe() {
1258
 
1258
 
1259
     #ifdef SERVO_ENDSTOPS
1259
     #ifdef SERVO_ENDSTOPS
1260
 
1260
 
1261
       // Retract Z Servo endstop if enabled
1261
       // Retract Z Servo endstop if enabled
1262
       if (servo_endstops[Z_AXIS] >= 0) {
1262
       if (servo_endstops[Z_AXIS] >= 0) {
1263
 
1263
 
1264
-        if (z_after > 0) {
1265
-          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_after);
1264
+        #if Z_RAISE_AFTER_PROBING > 0
1265
+          do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1266
           st_synchronize();
1266
           st_synchronize();
1267
-        }
1268
-      
1267
+        #endif
1268
+
1269
         #if SERVO_LEVELING
1269
         #if SERVO_LEVELING
1270
           servos[servo_endstops[Z_AXIS]].attach(0);
1270
           servos[servo_endstops[Z_AXIS]].attach(0);
1271
         #endif
1271
         #endif
1343
     run_z_probe();
1343
     run_z_probe();
1344
     float measured_z = current_position[Z_AXIS];
1344
     float measured_z = current_position[Z_AXIS];
1345
 
1345
 
1346
+    #if Z_RAISE_AFTER_PROBING > 0
1347
+      do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1348
+      st_synchronize();
1349
+    #endif
1350
+
1346
     #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1351
     #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1347
-      if (retract_action & ProbeRetract) retract_z_probe(z_before);
1352
+      if (retract_action & ProbeRetract) retract_z_probe();
1348
     #endif
1353
     #endif
1349
 
1354
 
1350
     if (verbose_level > 2) {
1355
     if (verbose_level > 2) {

Loading…
Cancel
Save