diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 826ad85ef2..4948cf3294 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if HAS_LCD_CONTRAST - #include "gcode/lcd/M250.h" -#endif - #if ENABLED(PREVENT_COLD_EXTRUSION) #include "gcode/config/M302.h" #endif diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index bb0b637c9a..157b8ffb94 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) { extern void gcode_M163(); extern void gcode_M164(); extern void gcode_M165(); -extern void gcode_M250(); extern void gcode_M302(); extern void gcode_M350(); extern void gcode_M351(); @@ -579,10 +578,8 @@ void GcodeSuite::process_next_command() { #endif #if HAS_LCD_CONTRAST - case 250: // M250: Set LCD contrast - gcode_M250(); - break; - #endif // HAS_LCD_CONTRAST + case 250: M250(); break; // M250: Set LCD contrast + #endif #if ENABLED(EXPERIMENTAL_I2CBUS) case 260: M260(); break; // M260: Send data to an i2c slave diff --git a/Marlin/src/gcode/lcd/M250.h b/Marlin/src/gcode/lcd/M250.cpp similarity index 86% rename from Marlin/src/gcode/lcd/M250.h rename to Marlin/src/gcode/lcd/M250.cpp index fbcb9045c9..bede88126a 100644 --- a/Marlin/src/gcode/lcd/M250.h +++ b/Marlin/src/gcode/lcd/M250.cpp @@ -20,12 +20,21 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if HAS_LCD_CONTRAST + +#include "../gcode.h" +#include "../../lcd/ultralcd.h" + /** * M250: Read and optionally set the LCD contrast */ -void gcode_M250() { +void GcodeSuite::M250() { if (parser.seen('C')) set_lcd_contrast(parser.value_int()); SERIAL_PROTOCOLPGM("lcd contrast value: "); SERIAL_PROTOCOL(lcd_contrast); SERIAL_EOL(); } + +#endif // HAS_LCD_CONTRAST