Disable leveling during G12 (#14385)

2.0.x
Darsey Litzenberger 5 years ago committed by Scott Lahteine
parent b3f42d2519
commit 946f6bdeaa

@ -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