|
@ -37,6 +37,11 @@ |
|
|
|
|
|
|
|
|
/**
|
|
|
/**
|
|
|
* G12: Clean the nozzle |
|
|
* G12: Clean the nozzle |
|
|
|
|
|
* |
|
|
|
|
|
* E<bool> : 0=Never or 1=Always apply the "software endstop" limits |
|
|
|
|
|
* P0 S<strokes> : Stroke cleaning with S strokes |
|
|
|
|
|
* P1 Sn T<objects> : Zigzag cleaning with S repeats and T zigzags |
|
|
|
|
|
* P2 Sn R<radius> : Circle cleaning with S repeats and R radius |
|
|
*/ |
|
|
*/ |
|
|
void GcodeSuite::G12() { |
|
|
void GcodeSuite::G12() { |
|
|
// Don't allow nozzle cleaning without homing first
|
|
|
// Don't allow nozzle cleaning without homing first
|
|
@ -45,14 +50,12 @@ void GcodeSuite::G12() { |
|
|
const uint8_t pattern = parser.ushortval('P', 0), |
|
|
const uint8_t pattern = parser.ushortval('P', 0), |
|
|
strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), |
|
|
strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), |
|
|
objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); |
|
|
objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES); |
|
|
const float radius = parser.floatval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); |
|
|
const float radius = parser.linearval('R', NOZZLE_CLEAN_CIRCLE_RADIUS); |
|
|
|
|
|
|
|
|
const bool seenxyz = parser.seen("XYZ"); |
|
|
const bool seenxyz = parser.seen("XYZ"); |
|
|
const uint8_t cleans = (!seenxyz || parser.boolval('X') ? _BV(X_AXIS) : 0) |
|
|
const uint8_t cleans = (!seenxyz || parser.boolval('X') ? _BV(X_AXIS) : 0) |
|
|
| (!seenxyz || parser.boolval('Y') ? _BV(Y_AXIS) : 0) |
|
|
| (!seenxyz || parser.boolval('Y') ? _BV(Y_AXIS) : 0) |
|
|
#if DISABLED(NOZZLE_CLEAN_NO_Z) |
|
|
| TERN(NOZZLE_CLEAN_NO_Z, 0, (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0)) |
|
|
| (!seenxyz || parser.boolval('Z') ? _BV(Z_AXIS) : 0) |
|
|
|
|
|
#endif |
|
|
|
|
|
; |
|
|
; |
|
|
|
|
|
|
|
|
#if HAS_LEVELING |
|
|
#if HAS_LEVELING |
|
@ -60,6 +63,8 @@ void GcodeSuite::G12() { |
|
|
TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); |
|
|
TEMPORARY_BED_LEVELING_STATE(!TEST(cleans, Z_AXIS) && planner.leveling_active); |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
TEMPORARY_SOFT_ENDSTOP_STATE(parser.boolval('E')); |
|
|
|
|
|
|
|
|
nozzle.clean(pattern, strokes, radius, objects, cleans); |
|
|
nozzle.clean(pattern, strokes, radius, objects, cleans); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|