From 92c15f5578aa5c6baa4609399bce7f756310ea97 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 17 Sep 2017 00:50:24 -0500 Subject: [PATCH] Move M150 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/feature/leds/{M150.h => M150.cpp} | 11 ++++++++++- Marlin/src/gcode/gcode.cpp | 9 ++------- 3 files changed, 12 insertions(+), 12 deletions(-) rename Marlin/src/gcode/feature/leds/{M150.h => M150.cpp} (90%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 988d696add..976ae21da2 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if HAS_COLOR_LEDS - #include "gcode/feature/leds/M150.h" -#endif - #include "gcode/config/M201.h" #if 0 // Not used for Sprinter/grbl gen6 diff --git a/Marlin/src/gcode/feature/leds/M150.h b/Marlin/src/gcode/feature/leds/M150.cpp similarity index 90% rename from Marlin/src/gcode/feature/leds/M150.h rename to Marlin/src/gcode/feature/leds/M150.cpp index 210616ea74..9608e90ee9 100644 --- a/Marlin/src/gcode/feature/leds/M150.h +++ b/Marlin/src/gcode/feature/leds/M150.cpp @@ -20,6 +20,13 @@ * */ +#include "../../../inc/MarlinConfig.h" + +#if HAS_COLOR_LEDS + +#include "../../gcode.h" +#include "../../../feature/leds/leds.h" + /** * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W * @@ -34,7 +41,7 @@ * M150 W ; Turn LED white using a white LED * */ -void gcode_M150() { +void GcodeSuite::M150() { set_led_color( parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0, @@ -44,3 +51,5 @@ void gcode_M150() { #endif ); } + +#endif // HAS_COLOR_LEDS diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index 0d6e2b1552..c6fddf2580 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) { // // Placeholders for non-migrated codes // -extern void gcode_M150(); extern void gcode_M163(); extern void gcode_M164(); extern void gcode_M165(); @@ -509,12 +508,8 @@ void GcodeSuite::process_next_command() { #endif #if HAS_COLOR_LEDS - - case 150: // M150: Set Status LED Color - gcode_M150(); - break; - - #endif // HAS_COLOR_LEDS + case 150: M150(); break; // M150: Set Status LED Color + #endif #if ENABLED(MIXING_EXTRUDER) case 163: // M163: Set a component weight for mixing extruder