Browse Source

Disable leveling during G12 (#14385)

pull/1/head
Darsey Litzenberger 6 years ago
committed by Scott Lahteine
parent
commit
946f6bdeaa
  1. 15
      Marlin/src/gcode/feature/clean/G12.cpp

15
Marlin/src/gcode/feature/clean/G12.cpp

@ -30,6 +30,11 @@
#include "../../parser.h"
#include "../../../module/motion.h"
#if HAS_LEVELING
#include "../../../module/planner.h"
#include "../../../feature/bedlevel/bedlevel.h"
#endif
/**
* G12: Clean the nozzle
*/
@ -42,7 +47,17 @@ void GcodeSuite::G12() {
objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES);
const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS);
#if HAS_LEVELING
const bool was_enabled = planner.leveling_active;
set_bed_leveling_enabled(false);
#endif
Nozzle::clean(pattern, strokes, radius, objects);
// Re-enable bed level correction if it had been on
#if HAS_LEVELING
set_bed_leveling_enabled(was_enabled);
#endif
}
#endif // NOZZLE_CLEAN_FEATURE

Loading…
Cancel
Save