Browse Source

Move M150 to cpp

Scott Lahteine 8 years ago
parent
commit
92c15f5578
3 changed files with 12 additions and 12 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 10
    1
      Marlin/src/gcode/feature/leds/M150.cpp
  3. 2
    7
      Marlin/src/gcode/gcode.cpp

+ 0
- 4
Marlin/src/Marlin.cpp View File

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

Marlin/src/gcode/feature/leds/M150.h → Marlin/src/gcode/feature/leds/M150.cpp View File

@@ -20,6 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../../inc/MarlinConfig.h"
24
+
25
+#if HAS_COLOR_LEDS
26
+
27
+#include "../../gcode.h"
28
+#include "../../../feature/leds/leds.h"
29
+
23 30
 /**
24 31
  * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W
25 32
  *
@@ -34,7 +41,7 @@
34 41
  *   M150 W          ; Turn LED white using a white LED
35 42
  *
36 43
  */
37
-void gcode_M150() {
44
+void GcodeSuite::M150() {
38 45
   set_led_color(
39 46
     parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
40 47
     parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
@@ -44,3 +51,5 @@ void gcode_M150() {
44 51
     #endif
45 52
   );
46 53
 }
54
+
55
+#endif // HAS_COLOR_LEDS

+ 2
- 7
Marlin/src/gcode/gcode.cpp View File

@@ -116,7 +116,6 @@ void GcodeSuite::dwell(millis_t time) {
116 116
 //
117 117
 // Placeholders for non-migrated codes
118 118
 //
119
-extern void gcode_M150();
120 119
 extern void gcode_M163();
121 120
 extern void gcode_M164();
122 121
 extern void gcode_M165();
@@ -509,12 +508,8 @@ void GcodeSuite::process_next_command() {
509 508
       #endif
510 509
 
511 510
       #if HAS_COLOR_LEDS
512
-
513
-        case 150: // M150: Set Status LED Color
514
-          gcode_M150();
515
-          break;
516
-
517
-      #endif // HAS_COLOR_LEDS
511
+        case 150: M150(); break;  // M150: Set Status LED Color
512
+      #endif
518 513
 
519 514
       #if ENABLED(MIXING_EXTRUDER)
520 515
         case 163: // M163: Set a component weight for mixing extruder

Loading…
Cancel
Save