|
@@ -37,6 +37,11 @@
|
37
|
37
|
|
38
|
38
|
/**
|
39
|
39
|
* G12: Clean the nozzle
|
|
40
|
+ *
|
|
41
|
+ * E<bool> : 0=Never or 1=Always apply the "software endstop" limits
|
|
42
|
+ * P0 S<strokes> : Stroke cleaning with S strokes
|
|
43
|
+ * P1 Sn T<objects> : Zigzag cleaning with S repeats and T zigzags
|
|
44
|
+ * P2 Sn R<radius> : Circle cleaning with S repeats and R radius
|
40
|
45
|
*/
|
41
|
46
|
void GcodeSuite::G12() {
|
42
|
47
|
// Don't allow nozzle cleaning without homing first
|
|
@@ -45,14 +50,12 @@ void GcodeSuite::G12() {
|
45
|
50
|
const uint8_t pattern = parser.ushortval('P', 0),
|
46
|
51
|
strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES),
|
47
|
52
|
objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES);
|
48
|
|
- const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS);
|
|
53
|
+ const float radius = parser.linearval('R', NOZZLE_CLEAN_CIRCLE_RADIUS);
|
49
|
54
|
|
50
|
55
|
const bool seenxyz = parser.seen("XYZ");
|
51
|
56
|
const uint8_t cleans = (!seenxyz || parser.boolval('X') ? _BV(X_AXIS) : 0)
|
52
|
57
|
| (!seenxyz || parser.boolval('Y') ? _BV(Y_AXIS) : 0)
|
53
|
|
- #if DISABLED(NOZZLE_CLEAN_NO_Z)
|
54
|
|
- | (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0)
|
55
|
|
- #endif
|
|
58
|
+ | TERN(NOZZLE_CLEAN_NO_Z, 0, (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0))
|
56
|
59
|
;
|
57
|
60
|
|
58
|
61
|
#if HAS_LEVELING
|
|
@@ -60,6 +63,8 @@ void GcodeSuite::G12() {
|
60
|
63
|
TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active);
|
61
|
64
|
#endif
|
62
|
65
|
|
|
66
|
+ TEMPORARY_SOFT_ENDSTOP_STATE(parser.boolval('E'));
|
|
67
|
+
|
63
|
68
|
nozzle.clean(pattern, strokes, radius, objects, cleans);
|
64
|
69
|
}
|
65
|
70
|
|