Browse Source

Move M150 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
92c15f5578
  1. 4
      Marlin/src/Marlin.cpp
  2. 11
      Marlin/src/gcode/feature/leds/M150.cpp
  3. 9
      Marlin/src/gcode/gcode.cpp

4
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

11
Marlin/src/gcode/feature/leds/M150.h → 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

9
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

Loading…
Cancel
Save