Browse Source

Screen out `G29 E` for sled and allen key, allow single probe

Scott Lahteine 9 years ago
parent
commit
5158bd6e93
1 changed files with 36 additions and 26 deletions
  1. 36
    26
      Marlin/Marlin_main.cpp

+ 36
- 26
Marlin/Marlin_main.cpp View File

@@ -2173,11 +2173,6 @@ static void setup_for_endstop_move() {
2173 2173
     // this also updates current_position
2174 2174
     do_blocking_move_to_xy(x - (X_PROBE_OFFSET_FROM_EXTRUDER), y - (Y_PROBE_OFFSET_FROM_EXTRUDER));
2175 2175
 
2176
-    // Z Sled and Allen Key should never deploy-and-stow
2177
-    #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
2178
-      if (probe_action == ProbeDeployAndStow) probe_action == ProbeStay;
2179
-    #endif
2180
-
2181 2176
     if (probe_action & ProbeDeploy) {
2182 2177
       #if ENABLED(DEBUG_LEVELING_FEATURE)
2183 2178
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> ProbeDeploy");
@@ -3370,8 +3365,11 @@ inline void gcode_G28() {
3370 3365
       return;
3371 3366
     }
3372 3367
 
3373
-    bool dryrun = code_seen('D'),
3374
-         deploy_probe_for_each_reading = code_seen('E');
3368
+    bool dryrun = code_seen('D');
3369
+
3370
+    #if DISABLED(Z_PROBE_SLED) && DISABLED(Z_PROBE_ALLEN_KEY)
3371
+      bool deploy_probe_for_each_reading = code_seen('E');
3372
+    #endif
3375 3373
 
3376 3374
     #if ENABLED(AUTO_BED_LEVELING_GRID)
3377 3375
 
@@ -3470,9 +3468,8 @@ inline void gcode_G28() {
3470 3468
 
3471 3469
     setup_for_endstop_or_probe_move();
3472 3470
 
3473
-    #if HAS_BED_PROBE
3474
-      deploy_z_probe();
3475
-    #endif
3471
+    // Deploy the probe. Servo will raise if needed.
3472
+    deploy_z_probe();
3476 3473
 
3477 3474
     feedrate = homing_feedrate[Z_AXIS];
3478 3475
 
@@ -3551,15 +3548,19 @@ inline void gcode_G28() {
3551 3548
             if (distance_from_center > DELTA_PROBEABLE_RADIUS) continue;
3552 3549
           #endif //DELTA
3553 3550
 
3554
-          ProbeAction act;
3555
-          if (deploy_probe_for_each_reading) // G29 E - Stow between probes
3556
-            act = ProbeDeployAndStow;
3557
-          else if (yCount == 0 && xCount == xStart)
3558
-            act = ProbeDeploy;
3559
-          else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc)
3560
-            act = ProbeStow;
3561
-          else
3562
-            act = ProbeStay;
3551
+          #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
3552
+            const ProbeAction act = ProbeStay;
3553
+          #else
3554
+            ProbeAction act;
3555
+            if (deploy_probe_for_each_reading) // G29 E - Stow between probes
3556
+              act = ProbeDeployAndStow;
3557
+            else if (yCount == 0 && xCount == xStart)
3558
+              act = ProbeDeploy;
3559
+            else if (yCount == auto_bed_leveling_grid_points - 1 && xCount == xStop - xInc)
3560
+              act = ProbeStow;
3561
+            else
3562
+              act = ProbeStay;
3563
+          #endif
3563 3564
 
3564 3565
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
3565 3566
 
@@ -3690,12 +3691,16 @@ inline void gcode_G28() {
3690 3691
         if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("> 3-point Leveling");
3691 3692
       #endif
3692 3693
 
3693
-      // Actions for each probe
3694
-      ProbeAction p1, p2, p3;
3695
-      if (deploy_probe_for_each_reading)
3696
-        p1 = p2 = p3 = ProbeDeployAndStow;
3697
-      else
3698
-        p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow;
3694
+      #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
3695
+        const ProbeAction p1 = ProbeStay, p2 = ProbeStay, p3 = ProbeStay;
3696
+      #else
3697
+        // Actions for each probe
3698
+        ProbeAction p1, p2, p3;
3699
+        if (deploy_probe_for_each_reading)
3700
+          p1 = p2 = p3 = ProbeDeployAndStow;
3701
+        else
3702
+          p1 = ProbeDeploy, p2 = ProbeStay, p3 = ProbeStow;
3703
+      #endif
3699 3704
 
3700 3705
       // Probe at 3 arbitrary points
3701 3706
       float z_at_pt_1 = probe_pt( ABL_PROBE_PT_1_X + home_offset[X_AXIS],
@@ -4189,7 +4194,12 @@ inline void gcode_M42() {
4189 4194
     float  X_current = current_position[X_AXIS],
4190 4195
            Y_current = current_position[Y_AXIS],
4191 4196
            Z_start_location = current_position[Z_AXIS] + Z_RAISE_BEFORE_PROBING;
4192
-    bool deploy_probe_for_each_reading = code_seen('E');
4197
+
4198
+    #if ENABLED(Z_PROBE_SLED) || ENABLED(Z_PROBE_ALLEN_KEY)
4199
+      const bool deploy_probe_for_each_reading = false;
4200
+    #else
4201
+      bool deploy_probe_for_each_reading = code_seen('E');
4202
+    #endif
4193 4203
 
4194 4204
     float X_probe_location = code_seen('X') ? code_value_axis_units(X_AXIS) : X_current + X_PROBE_OFFSET_FROM_EXTRUDER;
4195 4205
     #if DISABLED(DELTA)

Loading…
Cancel
Save