diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 24c61f24a..ce77844da 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -369,10 +369,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if ENABLED(ULTIPANEL) - #include "gcode/lcd/M145.h" -#endif - #if ENABLED(TEMPERATURE_UNITS_SUPPORT) #include "gcode/units/M149.h" #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index ffee42456..862202500 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -131,7 +131,6 @@ extern void gcode_M118(); extern void gcode_M119(); extern void gcode_M120(); extern void gcode_M121(); -extern void gcode_M145(); extern void gcode_M149(); extern void gcode_M150(); extern void gcode_M163(); @@ -544,11 +543,7 @@ void GcodeSuite::process_next_command() { break; #if ENABLED(ULTIPANEL) - - case 145: // M145: Set material heatup parameters - gcode_M145(); - break; - + case 145: M145(); break; // M145: Set material heatup parameters #endif #if ENABLED(TEMPERATURE_UNITS_SUPPORT) diff --git a/Marlin/src/gcode/lcd/M145.h b/Marlin/src/gcode/lcd/M145.cpp similarity index 91% rename from Marlin/src/gcode/lcd/M145.h rename to Marlin/src/gcode/lcd/M145.cpp index 3d203f1c3..3fda5bb04 100644 --- a/Marlin/src/gcode/lcd/M145.h +++ b/Marlin/src/gcode/lcd/M145.cpp @@ -20,6 +20,13 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(ULTIPANEL) + +#include "../gcode.h" +#include "../../lcd/ultralcd.h" + /** * M145: Set the heatup state for a material in the LCD menu * @@ -28,7 +35,7 @@ * B * F */ -void gcode_M145() { +void GcodeSuite::M145() { const uint8_t material = (uint8_t)parser.intval('S'); if (material >= COUNT(lcd_preheat_hotend_temp)) { SERIAL_ERROR_START(); @@ -52,3 +59,5 @@ void gcode_M145() { #endif } } + +#endif // ULTIPANEL