Bladeren bron

Clean up Z_RAISE_AFTER_PROBING to work the same in all code paths except Z_PROBE_SLED.

maverikou 10 jaren geleden
bovenliggende
commit
0f034dd97e
1 gewijzigde bestanden met toevoegingen van 9 en 13 verwijderingen
  1. 9
    13
      Marlin/Marlin_main.cpp

+ 9
- 13
Marlin/Marlin_main.cpp Bestand weergeven

@@ -1326,7 +1326,7 @@ static void retract_z_probe() {
1326 1326
   #elif defined(Z_PROBE_ALLEN_KEY)
1327 1327
     // Move up for safety
1328 1328
     feedrate = homing_feedrate[X_AXIS];
1329
-    destination[Z_AXIS] = current_position[Z_AXIS] + 20;
1329
+    destination[Z_AXIS] = current_position[Z_AXIS] + Z_RAISE_AFTER_PROBING;
1330 1330
     prepare_move_raw();
1331 1331
 
1332 1332
     // Move to the start position to initiate retraction
@@ -1370,26 +1370,26 @@ static void retract_z_probe() {
1370 1370
 
1371 1371
 enum ProbeAction
1372 1372
 {
1373
-    ProbeStay              = 0,
1374
-    ProbeEngage            = (1 << 0),
1375
-    ProbeRetract           = (1 << 1),
1376
-    ProbeEngageAndRectract = (ProbeEngage | ProbeRetract),
1373
+    ProbeStay             = 0,
1374
+    ProbeEngage           = (1 << 0),
1375
+    ProbeRetract          = (1 << 1),
1376
+    ProbeEngageAndRetract = (ProbeEngage | ProbeRetract),
1377 1377
 };
1378 1378
 
1379 1379
 /// Probe bed height at position (x,y), returns the measured z value
1380
-static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRectract, int verbose_level=1) {
1380
+static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRetract, int verbose_level=1) {
1381 1381
   // move to right place
1382 1382
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1383 1383
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1384 1384
 
1385
-  #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1385
+  #if !defined(Z_PROBE_SLED)
1386 1386
     if (retract_action & ProbeEngage) engage_z_probe();
1387 1387
   #endif
1388 1388
 
1389 1389
   run_z_probe();
1390 1390
   float measured_z = current_position[Z_AXIS];
1391 1391
 
1392
-  #if !defined(Z_PROBE_SLED) && !defined(Z_PROBE_ALLEN_KEY)
1392
+  #if !defined(Z_PROBE_SLED)
1393 1393
     if (retract_action & ProbeRetract) retract_z_probe();
1394 1394
   #endif
1395 1395
 
@@ -2231,8 +2231,6 @@ inline void gcode_G28() {
2231 2231
 
2232 2232
     #ifdef Z_PROBE_SLED
2233 2233
       dock_sled(false); // engage (un-dock) the probe
2234
-    #elif not defined(SERVO_ENDSTOPS)
2235
-      engage_z_probe();
2236 2234
     #endif
2237 2235
 
2238 2236
     st_synchronize();
@@ -2340,7 +2338,7 @@ inline void gcode_G28() {
2340 2338
               act = ProbeStay;
2341 2339
           }
2342 2340
           else
2343
-            act = ProbeEngageAndRectract;
2341
+            act = ProbeEngageAndRetract;
2344 2342
 
2345 2343
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2346 2344
 
@@ -2474,8 +2472,6 @@ inline void gcode_G28() {
2474 2472
 
2475 2473
   #ifdef Z_PROBE_SLED
2476 2474
     dock_sled(true, -SLED_DOCKING_OFFSET); // dock the probe, correcting for over-travel
2477
-  #elif not defined(SERVO_ENDSTOPS)
2478
-    retract_z_probe();
2479 2475
   #endif
2480 2476
     
2481 2477
   #ifdef Z_PROBE_END_SCRIPT

Laden…
Annuleren
Opslaan