Move M150 to cpp

This commit is contained in:
Scott Lahteine 2017-09-17 00:50:24 -05:00
parent eef4a54778
commit 92c15f5578
3 changed files with 12 additions and 12 deletions

View File

@ -355,10 +355,6 @@ bool pin_is_protected(const int8_t pin) {
return false; return false;
} }
#if HAS_COLOR_LEDS
#include "gcode/feature/leds/M150.h"
#endif
#include "gcode/config/M201.h" #include "gcode/config/M201.h"
#if 0 // Not used for Sprinter/grbl gen6 #if 0 // Not used for Sprinter/grbl gen6

View File

@ -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 * 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 * M150 W ; Turn LED white using a white LED
* *
*/ */
void gcode_M150() { void GcodeSuite::M150() {
set_led_color( set_led_color(
parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0, parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
parser.seen('U') ? (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
); );
} }
#endif // HAS_COLOR_LEDS

View File

@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
// //
// Placeholders for non-migrated codes // Placeholders for non-migrated codes
// //
extern void gcode_M150();
extern void gcode_M163(); extern void gcode_M163();
extern void gcode_M164(); extern void gcode_M164();
extern void gcode_M165(); extern void gcode_M165();
@ -509,12 +508,8 @@ void GcodeSuite::process_next_command() {
#endif #endif
#if HAS_COLOR_LEDS #if HAS_COLOR_LEDS
case 150: M150(); break; // M150: Set Status LED Color
case 150: // M150: Set Status LED Color #endif
gcode_M150();
break;
#endif // HAS_COLOR_LEDS
#if ENABLED(MIXING_EXTRUDER) #if ENABLED(MIXING_EXTRUDER)
case 163: // M163: Set a component weight for mixing extruder case 163: // M163: Set a component weight for mixing extruder