Browse Source

Disable leveling during G12 (#14385)

Darsey Litzenberger 5 years ago
parent
commit
946f6bdeaa
1 changed files with 15 additions and 0 deletions
  1. 15
    0
      Marlin/src/gcode/feature/clean/G12.cpp

+ 15
- 0
Marlin/src/gcode/feature/clean/G12.cpp View File

@@ -30,6 +30,11 @@
30 30
 #include "../../parser.h"
31 31
 #include "../../../module/motion.h"
32 32
 
33
+#if HAS_LEVELING
34
+  #include "../../../module/planner.h"
35
+  #include "../../../feature/bedlevel/bedlevel.h"
36
+#endif
37
+
33 38
 /**
34 39
  * G12: Clean the nozzle
35 40
  */
@@ -42,7 +47,17 @@ void GcodeSuite::G12() {
42 47
                 objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES);
43 48
   const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS);
44 49
 
50
+  #if HAS_LEVELING
51
+    const bool was_enabled = planner.leveling_active;
52
+    set_bed_leveling_enabled(false);
53
+  #endif
54
+
45 55
   Nozzle::clean(pattern, strokes, radius, objects);
56
+
57
+  // Re-enable bed level correction if it had been on
58
+  #if HAS_LEVELING
59
+    set_bed_leveling_enabled(was_enabled);
60
+  #endif
46 61
 }
47 62
 
48 63
 #endif // NOZZLE_CLEAN_FEATURE

Loading…
Cancel
Save