From b4b19aef7f61c6dffa5ae51d76b5508296ac703b Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Wed, 22 Jul 2020 02:42:44 -0400 Subject: [PATCH] Custom Nozzle Wipe (#18736) --- Marlin/Configuration.h | 4 ++++ Marlin/src/gcode/feature/clean/G12.cpp | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index af98be4d1..fccdf9ced 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -1595,6 +1595,10 @@ // Enable for a purge/clean station that's always at the gantry height (thus no Z move) //#define NOZZLE_CLEAN_NO_Z + + // Explicit wipe G-code script applies to a G12 with no arguments. + //#define WIPE_SEQUENCE_COMMANDS "G1 X-17 Y25 Z10 F4000\nG1 Z1\nM114\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 X-17 Y25\nG1 X-17 Y95\nG1 Z15\nM400\nG0 X-10.0 Y-9.0" + #endif /** diff --git a/Marlin/src/gcode/feature/clean/G12.cpp b/Marlin/src/gcode/feature/clean/G12.cpp index bdfaf38a0..6337665d4 100644 --- a/Marlin/src/gcode/feature/clean/G12.cpp +++ b/Marlin/src/gcode/feature/clean/G12.cpp @@ -47,6 +47,13 @@ void GcodeSuite::G12() { // Don't allow nozzle cleaning without homing first if (axis_unhomed_error()) return; + #ifdef WIPE_SEQUENCE_COMMANDS + if (!parser.seen_any()) { + gcode.process_subcommands_now_P(PSTR(WIPE_SEQUENCE_COMMANDS)); + return; + } + #endif + const uint8_t pattern = parser.ushortval('P', 0), strokes = parser.ushortval('S', NOZZLE_CLEAN_STROKES), objects = parser.ushortval('T', NOZZLE_CLEAN_TRIANGLES);