瀏覽代碼

Blind fix for #1507

maverikou 10 年之前
父節點
當前提交
6c96f32069
共有 1 個文件被更改,包括 14 次插入7 次删除
  1. 14
    7
      Marlin/Marlin_main.cpp

+ 14
- 7
Marlin/Marlin_main.cpp 查看文件

1309
 static void retract_z_probe() {
1309
 static void retract_z_probe() {
1310
   // Retract Z Servo endstop if enabled
1310
   // Retract Z Servo endstop if enabled
1311
   #ifdef SERVO_ENDSTOPS
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
       #if SERVO_LEVELING
1317
       #if SERVO_LEVELING
1314
         servos[servo_endstops[Z_AXIS]].attach(0);
1318
         servos[servo_endstops[Z_AXIS]].attach(0);
1315
       #endif
1319
       #endif
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
 /// Probe bed height at position (x,y), returns the measured z value
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
   // move to right place
1381
   // move to right place
1372
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1382
   do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
1373
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
1383
   do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);
2330
               act = ProbeStay;
2340
               act = ProbeStay;
2331
           }
2341
           }
2332
           else
2342
           else
2333
-            act = ProbeEngageRetract;
2343
+            act = ProbeEngageAndRectract;
2334
 
2344
 
2335
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2345
           measured_z = probe_pt(xProbe, yProbe, z_before, act, verbose_level);
2336
 
2346
 
2445
 
2455
 
2446
     #endif // !AUTO_BED_LEVELING_GRID
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
   #ifndef DELTA
2458
   #ifndef DELTA
2452
     if (verbose_level > 0)
2459
     if (verbose_level > 0)
2453
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");
2460
       plan_bed_level_matrix.debug(" \n\nBed Level Correction Matrix:");

Loading…
取消
儲存