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
   return false;
355
   return false;
356
 }
356
 }
357
 
357
 
358
-#if HAS_COLOR_LEDS
359
-  #include "gcode/feature/leds/M150.h"
360
-#endif
361
-
362
 #include "gcode/config/M201.h"
358
 #include "gcode/config/M201.h"
363
 
359
 
364
 #if 0 // Not used for Sprinter/grbl gen6
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
  *
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
  * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W
31
  * M150: Set Status LED Color - Use R-U-B-W for R-G-B-W
25
  *
32
  *
34
  *   M150 W          ; Turn LED white using a white LED
41
  *   M150 W          ; Turn LED white using a white LED
35
  *
42
  *
36
  */
43
  */
37
-void gcode_M150() {
44
+void GcodeSuite::M150() {
38
   set_led_color(
45
   set_led_color(
39
     parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
46
     parser.seen('R') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
40
     parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
47
     parser.seen('U') ? (parser.has_value() ? parser.value_byte() : 255) : 0,
44
     #endif
51
     #endif
45
   );
52
   );
46
 }
53
 }
54
+
55
+#endif // HAS_COLOR_LEDS

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

116
 //
116
 //
117
 // Placeholders for non-migrated codes
117
 // Placeholders for non-migrated codes
118
 //
118
 //
119
-extern void gcode_M150();
120
 extern void gcode_M163();
119
 extern void gcode_M163();
121
 extern void gcode_M164();
120
 extern void gcode_M164();
122
 extern void gcode_M165();
121
 extern void gcode_M165();
509
       #endif
508
       #endif
510
 
509
 
511
       #if HAS_COLOR_LEDS
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
       #if ENABLED(MIXING_EXTRUDER)
514
       #if ENABLED(MIXING_EXTRUDER)
520
         case 163: // M163: Set a component weight for mixing extruder
515
         case 163: // M163: Set a component weight for mixing extruder

Loading…
Cancel
Save