From c5ec80d6c7a9acc40e4d0dd20d6282d6ec192461 Mon Sep 17 00:00:00 2001 From: InsanityAutomation <38436470+InsanityAutomation@users.noreply.github.com> Date: Sat, 25 Jul 2020 00:31:15 -0400 Subject: [PATCH] G425/G35 menu items; G425 pre- and post- scripts (#18737) --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/gcode/calibrate/G425.cpp | 9 +++++++++ Marlin/src/lcd/language/language_en.h | 1 + Marlin/src/lcd/menu/menu_motion.cpp | 14 ++++++++++++++ 4 files changed, 27 insertions(+) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index f27e2722c..3f097c09e 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -898,6 +898,9 @@ //#define CALIBRATION_GCODE #if ENABLED(CALIBRATION_GCODE) + //#define CALIBRATION_SCRIPT_PRE "M117 Starting Auto-Calibration\nT0\nG28\nG12\nM117 Calibrating..." + //#define CALIBRATION_SCRIPT_POST "M500\nM117 Calibration data saved" + #define CALIBRATION_MEASUREMENT_RESOLUTION 0.01 // mm #define CALIBRATION_FEEDRATE_SLOW 60 // mm/m diff --git a/Marlin/src/gcode/calibrate/G425.cpp b/Marlin/src/gcode/calibrate/G425.cpp index c14e5e395..0ef23d28f 100644 --- a/Marlin/src/gcode/calibrate/G425.cpp +++ b/Marlin/src/gcode/calibrate/G425.cpp @@ -576,6 +576,11 @@ inline void calibrate_all() { * no args - Perform entire calibration sequence (backlash + position on all toolheads) */ void GcodeSuite::G425() { + + #ifdef CALIBRATION_SCRIPT_PRE + GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_PRE)); + #endif + TEMPORARY_SOFT_ENDSTOP_STATE(false); TEMPORARY_BED_LEVELING_STATE(false); @@ -606,6 +611,10 @@ void GcodeSuite::G425() { #endif else calibrate_all(); + + #ifdef CALIBRATION_SCRIPT_POST + GcodeSuite::process_subcommands_now_P(PSTR(CALIBRATION_SCRIPT_POST)); + #endif } #endif // CALIBRATION_GCODE diff --git a/Marlin/src/lcd/language/language_en.h b/Marlin/src/lcd/language/language_en.h index de8cfc85f..391cb598c 100644 --- a/Marlin/src/lcd/language/language_en.h +++ b/Marlin/src/lcd/language/language_en.h @@ -66,6 +66,7 @@ namespace Language_en { PROGMEM Language_Str MSG_AUTO_HOME_Y = _UxGT("Home Y"); PROGMEM Language_Str MSG_AUTO_HOME_Z = _UxGT("Home Z"); PROGMEM Language_Str MSG_AUTO_Z_ALIGN = _UxGT("Auto Z-Align"); + PROGMEM Language_Str MSG_ASSISTED_TRAMMING = _UxGT("Assisted Tramming"); PROGMEM Language_Str MSG_LEVEL_BED_HOMING = _UxGT("Homing XYZ"); PROGMEM Language_Str MSG_LEVEL_BED_WAITING = _UxGT("Click to Begin"); PROGMEM Language_Str MSG_LEVEL_BED_NEXT_POINT = _UxGT("Next Point"); diff --git a/Marlin/src/lcd/menu/menu_motion.cpp b/Marlin/src/lcd/menu/menu_motion.cpp index 9b16b68e4..9c49a3cdb 100644 --- a/Marlin/src/lcd/menu/menu_motion.cpp +++ b/Marlin/src/lcd/menu/menu_motion.cpp @@ -325,6 +325,13 @@ void menu_motion() { GCODES_ITEM(MSG_AUTO_HOME_Z, PSTR("G28Z")); #endif + // + // Auto-calibration + // + #if ENABLED(CALIBRATION_GCODE) + GCODES_ITEM(MSG_AUTO_CALIBRATE, PSTR("G425")); + #endif + // // Auto Z-Align // @@ -332,6 +339,13 @@ void menu_motion() { GCODES_ITEM(MSG_AUTO_Z_ALIGN, PSTR("G34")); #endif + // + // Assisted Bed Tramming + // + #if ENABLED(ASSISTED_TRAMMING) + GCODES_ITEM(MSG_ASSISTED_TRAMMING, PSTR("G35")); + #endif + // // Level Bed //