Browse Source

Allow consecutive uses of G29

Scott Lahteine 7 years ago
parent
commit
f2731c9f93
1 changed files with 7 additions and 10 deletions
  1. 7
    10
      Marlin/src/gcode/bedlevel/abl/G29.cpp

+ 7
- 10
Marlin/src/gcode/bedlevel/abl/G29.cpp View File

390
     stepper.synchronize();
390
     stepper.synchronize();
391
 
391
 
392
     // Disable auto bed leveling during G29
392
     // Disable auto bed leveling during G29
393
-    planner.leveling_active = false;
393
+    // Be formal so G29 can be done successively without G28.
394
+    set_bed_leveling_enabled(false);
394
 
395
 
395
     if (!dryrun) {
396
     if (!dryrun) {
396
       // Re-orient the current position without leveling
397
       // Re-orient the current position without leveling
404
     #if HAS_BED_PROBE
405
     #if HAS_BED_PROBE
405
       // Deploy the probe. Probe will raise if needed.
406
       // Deploy the probe. Probe will raise if needed.
406
       if (DEPLOY_PROBE()) {
407
       if (DEPLOY_PROBE()) {
407
-        planner.leveling_active = abl_should_enable;
408
+        set_bed_leveling_enabled(abl_should_enable);
408
         return;
409
         return;
409
       }
410
       }
410
     #endif
411
     #endif
421
         || left_probe_bed_position != bilinear_start[X_AXIS]
422
         || left_probe_bed_position != bilinear_start[X_AXIS]
422
         || front_probe_bed_position != bilinear_start[Y_AXIS]
423
         || front_probe_bed_position != bilinear_start[Y_AXIS]
423
       ) {
424
       ) {
424
-        if (dryrun) {
425
-          // Before reset bed level, re-enable to correct the position
426
-          planner.leveling_active = abl_should_enable;
427
-        }
428
         // Reset grid to 0.0 or "not probed". (Also disables ABL)
425
         // Reset grid to 0.0 or "not probed". (Also disables ABL)
429
         reset_bed_level();
426
         reset_bed_level();
430
 
427
 
468
       #if HAS_SOFTWARE_ENDSTOPS
465
       #if HAS_SOFTWARE_ENDSTOPS
469
         soft_endstops_enabled = enable_soft_endstops;
466
         soft_endstops_enabled = enable_soft_endstops;
470
       #endif
467
       #endif
471
-      planner.leveling_active = abl_should_enable;
468
+      set_bed_leveling_enabled(abl_should_enable);
472
       g29_in_progress = false;
469
       g29_in_progress = false;
473
       #if ENABLED(LCD_BED_LEVELING)
470
       #if ENABLED(LCD_BED_LEVELING)
474
         lcd_wait_for_move = false;
471
         lcd_wait_for_move = false;
673
           measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
670
           measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
674
 
671
 
675
           if (isnan(measured_z)) {
672
           if (isnan(measured_z)) {
676
-            planner.leveling_active = abl_should_enable;
673
+            set_bed_leveling_enabled(abl_should_enable);
677
             break;
674
             break;
678
           }
675
           }
679
 
676
 
709
         yProbe = points[i].y;
706
         yProbe = points[i].y;
710
         measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
707
         measured_z = faux ? 0.001 * random(-100, 101) : probe_pt(xProbe, yProbe, stow_probe_after_each, verbose_level);
711
         if (isnan(measured_z)) {
708
         if (isnan(measured_z)) {
712
-          planner.leveling_active = abl_should_enable;
709
+          set_bed_leveling_enabled(abl_should_enable);
713
           break;
710
           break;
714
         }
711
         }
715
         points[i].z = measured_z;
712
         points[i].z = measured_z;
732
 
729
 
733
     // Raise to _Z_CLEARANCE_DEPLOY_PROBE. Stow the probe.
730
     // Raise to _Z_CLEARANCE_DEPLOY_PROBE. Stow the probe.
734
     if (STOW_PROBE()) {
731
     if (STOW_PROBE()) {
735
-      planner.leveling_active = abl_should_enable;
732
+      set_bed_leveling_enabled(abl_should_enable);
736
       measured_z = NAN;
733
       measured_z = NAN;
737
     }
734
     }
738
   }
735
   }

Loading…
Cancel
Save