Browse Source

Don't include Z_RAISE_AFTER_PROBING if not used (PR#2527)

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

+ 13
- 4
Marlin/Marlin_main.cpp View File

1425
 
1425
 
1426
       // Move up for safety
1426
       // Move up for safety
1427
       feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1427
       feedrate = Z_PROBE_ALLEN_KEY_STOW_1_FEEDRATE;
1428
-      destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1429
-      prepare_move_raw(); // this will also set_current_to_destination
1428
+
1429
+      #if Z_RAISE_AFTER_PROBING > 0
1430
+        destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1431
+        prepare_move_raw(); // this will also set_current_to_destination
1432
+      #endif
1430
 
1433
 
1431
       // Move to the start position to initiate retraction
1434
       // Move to the start position to initiate retraction
1432
       destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
1435
       destination[X_AXIS] = Z_PROBE_ALLEN_KEY_STOW_1_X;
1610
 
1613
 
1611
     float oldXpos = current_position[X_AXIS]; // save x position
1614
     float oldXpos = current_position[X_AXIS]; // save x position
1612
     if (dock) {
1615
     if (dock) {
1613
-      do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z   
1616
+      #if Z_RAISE_AFTER_PROBING > 0
1617
+        do_blocking_move_to_z(current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING); // raise Z
1618
+      #endif
1614
       do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);  // Dock sled a bit closer to ensure proper capturing
1619
       do_blocking_move_to_x(X_MAX_POS + SLED_DOCKING_OFFSET + offset - 1);  // Dock sled a bit closer to ensure proper capturing
1615
       digitalWrite(SLED_PIN, LOW); // turn off magnet
1620
       digitalWrite(SLED_PIN, LOW); // turn off magnet
1616
     } else {
1621
     } else {
2766
         //      adjust for inaccurate endstops, not for reasonably accurate probes. If it were
2771
         //      adjust for inaccurate endstops, not for reasonably accurate probes. If it were
2767
         //      added here, it could be seen as a compensating factor for the Z probe.
2772
         //      added here, it could be seen as a compensating factor for the Z probe.
2768
         //
2773
         //
2769
-        current_position[Z_AXIS] = -zprobe_zoffset + Z_RAISE_AFTER_PROBING + (z_tmp - real_z);
2774
+        current_position[Z_AXIS] = -zprobe_zoffset + (z_tmp - real_z)
2775
+          #if ENABLED(SERVO_ENDSTOPS) || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED)
2776
+             + Z_RAISE_AFTER_PROBING
2777
+          #endif
2778
+          ;
2770
         // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The probe determines Z=0, not "Z home"
2779
         // current_position[Z_AXIS] += home_offset[Z_AXIS]; // The probe determines Z=0, not "Z home"
2771
         sync_plan_position();
2780
         sync_plan_position();
2772
       }
2781
       }

Loading…
Cancel
Save