From e9ae5208cbf1948b92e08ee463a1ecfba53be722 Mon Sep 17 00:00:00 2001 From: Vovodroid Date: Tue, 27 May 2025 03:16:45 +0300 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20EVENT=5FGCODE=5FAFTER=5FMPC=5FTUNE?= =?UTF-8?q?=20(#27865)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Scott Lahteine --- Marlin/Configuration.h | 1 + Marlin/src/module/temperature.cpp | 4 ++++ buildroot/tests/STM32F103RE_creality | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 859f0bbd33..08216d17b8 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -767,6 +767,7 @@ #define MPC_TUNING_POS { X_CENTER, Y_CENTER, 1.0f } // (mm) M306 Autotuning position, ideally bed center at first layer height. #define MPC_TUNING_END_Z 10.0f // (mm) M306 Autotuning final Z position. + //#define EVENT_GCODE_AFTER_MPC_TUNE "M84" // G-code to execute after MPC tune finished and Z raised. #endif //=========================================================================== diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index 30690345a5..5c760a7689 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -1104,6 +1104,10 @@ void Temperature::factory_reset() { do_z_clearance(MPC_TUNING_END_Z, false); + #ifdef EVENT_GCODE_AFTER_MPC_TUNE + gcode.process_subcommands_now(F(EVENT_GCODE_AFTER_MPC_TUNE)); + #endif + TERN_(TEMP_TUNING_MAINTAIN_FAN, adaptive_fan_slowing = true); } diff --git a/buildroot/tests/STM32F103RE_creality b/buildroot/tests/STM32F103RE_creality index 5681688929..0855a71ee4 100755 --- a/buildroot/tests/STM32F103RE_creality +++ b/buildroot/tests/STM32F103RE_creality @@ -20,7 +20,8 @@ exec_test $1 $2 "Ender-3 V2 - JyersUI (ABL Bilinear/Manual)" "$3" use_example_configs "Creality/Ender-3 V2/CrealityV422/CrealityUI" opt_disable DWIN_CREALITY_LCD PIDTEMP -opt_enable DWIN_MARLINUI_LANDSCAPE LCD_ENDSTOP_TEST AUTO_BED_LEVELING_UBL BLTOUCH Z_SAFE_HOMING MPCTEMP MPC_AUTOTUNE \ +opt_enable DWIN_MARLINUI_LANDSCAPE LCD_ENDSTOP_TEST AUTO_BED_LEVELING_UBL BLTOUCH Z_SAFE_HOMING \ + MPCTEMP MPC_AUTOTUNE EVENT_GCODE_AFTER_MPC_TUNE \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE GAMES_EASTER_EGG exec_test $1 $2 "Ender-3 V2 - MarlinUI (Games, UBL+BLTOUCH, MPCTEMP, LCD_ENDSTOP_TEST)" "$3"