maverikou il y a 10 ans
Parent
révision
6c96f32069
1 fichiers modifiés avec 14 ajouts et 7 suppressions
  1. 14
    7
      Marlin/Marlin_main.cpp

+ 14
- 7
Marlin/Marlin_main.cpp Voir le fichier

@@ -1309,7 +1309,11 @@ static void engage_z_probe() {
1309 1309
 static void retract_z_probe() {
1310 1310
   // Retract Z Servo endstop if enabled
1311 1311
   #ifdef SERVO_ENDSTOPS
1312
-    if (servo_endstops[Z_AXIS] > -1) {
1312
+    if (servo_endstops[Z_AXIS] > -1)
1313
+    {
1314
+        do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
1315
+        st_synchronize();
1316
+    
1313 1317
       #if SERVO_LEVELING
1314 1318
         servos[servo_endstops[Z_AXIS]].attach(0);
1315 1319
       #endif
@@ -1364,10 +1368,16 @@ static void retract_z_probe() {
1364 1368
 
1365 1369
 }
1366 1370
 
1367
-enum ProbeAction { ProbeStay, ProbeEngage, ProbeRetract, ProbeEngageRetract };
1371
+enum ProbeAction
1372
+{
1373
+    ProbeStay              = 0,
1374
+    ProbeEngage            = (1 << 0),
1375
+    ProbeRetract           = (1 << 1),
1376
+    ProbeEngageAndRectract = (ProbeEngage | ProbeRetract),
1377
+};
1368 1378
 
1369 1379
 /// Probe bed height at position (x,y), returns the measured z value
1370
-static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageRetract, int verbose_level=1) {
1380
+static float probe_pt(float x, float y, float z_before, ProbeAction retract_action=ProbeEngageAndRectract, int verbose_level=1) {
1371 1381
   // move to right place
1372 1382
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1373 1383
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
@@ -2330,7 +2340,7 @@ inline void gcode_G28() {
2330 2340
               act = ProbeStay;
2331 2341
           }
2332 2342
           else
2333
-            act = ProbeEngageRetract;
2343
+            act = ProbeEngageAndRectract;
2334 2344
 
2335 2345
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2336 2346
 
@@ -2445,9 +2455,6 @@ inline void gcode_G28() {
2445 2455
 
2446 2456
     #endif // !AUTO_BED_LEVELING_GRID
2447 2457
 
2448
-    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], Z_RAISE_AFTER_PROBING);
2449
-    st_synchronize();
2450
-
2451 2458
   #ifndef DELTA
2452 2459
     if (verbose_level > 0)
2453 2460
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");

Chargement…
Annuler
Enregistrer