From 0877585bd12a727cf309305ea0a761fdc3547963 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 18 Sep 2023 15:45:13 +0200 Subject: [PATCH 1/2] Add M420 Same as G81 --- Firmware/Marlin_main.cpp | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index dc2a588185..b1568a488f 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3085,6 +3085,16 @@ static void gcode_G80() mesh_bed_leveling_flag = false; } +// G80_M420 Mesh bed leveling status + +static void gcode_G81_M420() +{ + if (mbl.active) { + mbl.print(); + } else SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); + return; +} + //! @brief Calibrate XYZ //! @param onlyZ if true, calibrate only Z axis //! @param verbosity_level @@ -3785,7 +3795,7 @@ extern uint8_t st_backlash_y; //!@n G31 - Dock sled (Z_PROBE_SLED only) //!@n G32 - Undock sled (Z_PROBE_SLED only) //!@n G80 - Automatic mesh bed leveling -//!@n G81 - Print bed profile +//!@n G81 - Mesh bed leveling status //!@n G90 - Use Absolute Coordinates //!@n G91 - Use Relative Coordinates //!@n G92 - Set current position to coordinates given @@ -3875,6 +3885,7 @@ extern uint8_t st_backlash_y; //!@n M404 - N Enter the nominal filament width (3mm, 1.75mm ) or will display nominal filament width without parameters //!@n M405 - Turn on Filament Sensor extrusion control. Optional D to set delay in centimeters between sensor and extruder //!@n M406 - Turn off Filament Sensor extrusion control +//!@n M420 - Mesh bed leveling status //!@n M500 - stores parameters in EEPROM //!@n M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily). //!@n M502 - reverts to the default "factory settings". You still need to store them in EEPROM afterwards if you want to. @@ -4912,14 +4923,10 @@ void process_commands() ### G81 - Mesh bed leveling status G81: Mesh bed leveling status Prints mesh bed leveling status and bed profile if activated. */ - case 81: - if (mbl.active) { - mbl.print(); - } - else - SERIAL_PROTOCOLLNPGM("Mesh bed leveling not active."); - break; - + case 81: { + gcode_G81_M420(); + } + break; #if 0 /*! ### G82: Single Z probe at current location - Not active G82: Single Z probe at current location @@ -7395,6 +7402,16 @@ SERIAL_PROTOCOLPGM("\n\n"); break; #endif + /*! + ### M420 - Mesh bed leveling status M420: Mesh bed leveling status + Prints mesh bed leveling status and bed profile if activated. + */ + case 420: // M420 Mesh bed leveling status + { + gcode_G81_M420(); + } + break; + /*! ### M500 - Store settings in EEPROM M500: Store parameters in non-volatile storage Save current parameters to EEPROM. From 039202f34bfab3bfd4587b22eaa23e5c9e20bec6 Mon Sep 17 00:00:00 2001 From: 3d-gussner <3d.gussner@gmail.com> Date: Mon, 18 Sep 2023 15:48:36 +0200 Subject: [PATCH 2/2] Fix typo --- Firmware/Marlin_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index b1568a488f..e56fae8ec5 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3085,7 +3085,7 @@ static void gcode_G80() mesh_bed_leveling_flag = false; } -// G80_M420 Mesh bed leveling status +// G81_M420 Mesh bed leveling status static void gcode_G81_M420() {