Browse Source

Move M145 to cpp

Scott Lahteine 6 years ago
parent
commit
cbf40f7ee9
3 changed files with 11 additions and 11 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    6
      Marlin/src/gcode/gcode.cpp
  3. 10
    1
      Marlin/src/gcode/lcd/M145.cpp

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

@@ -369,10 +369,6 @@ bool pin_is_protected(const int8_t pin) {
369 369
   return false;
370 370
 }
371 371
 
372
-#if ENABLED(ULTIPANEL)
373
-  #include "gcode/lcd/M145.h"
374
-#endif
375
-
376 372
 #if ENABLED(TEMPERATURE_UNITS_SUPPORT)
377 373
   #include "gcode/units/M149.h"
378 374
 #endif

+ 1
- 6
Marlin/src/gcode/gcode.cpp View File

@@ -131,7 +131,6 @@ extern void gcode_M118();
131 131
 extern void gcode_M119();
132 132
 extern void gcode_M120();
133 133
 extern void gcode_M121();
134
-extern void gcode_M145();
135 134
 extern void gcode_M149();
136 135
 extern void gcode_M150();
137 136
 extern void gcode_M163();
@@ -544,11 +543,7 @@ void GcodeSuite::process_next_command() {
544 543
         break;
545 544
 
546 545
       #if ENABLED(ULTIPANEL)
547
-
548
-        case 145: // M145: Set material heatup parameters
549
-          gcode_M145();
550
-          break;
551
-
546
+        case 145: M145(); break;  // M145: Set material heatup parameters
552 547
       #endif
553 548
 
554 549
       #if ENABLED(TEMPERATURE_UNITS_SUPPORT)

Marlin/src/gcode/lcd/M145.h → Marlin/src/gcode/lcd/M145.cpp View File

@@ -20,6 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(ULTIPANEL)
26
+
27
+#include "../gcode.h"
28
+#include "../../lcd/ultralcd.h"
29
+
23 30
 /**
24 31
  * M145: Set the heatup state for a material in the LCD menu
25 32
  *
@@ -28,7 +35,7 @@
28 35
  *   B<bed temp>
29 36
  *   F<fan speed>
30 37
  */
31
-void gcode_M145() {
38
+void GcodeSuite::M145() {
32 39
   const uint8_t material = (uint8_t)parser.intval('S');
33 40
   if (material >= COUNT(lcd_preheat_hotend_temp)) {
34 41
     SERIAL_ERROR_START();
@@ -52,3 +59,5 @@ void gcode_M145() {
52 59
     #endif
53 60
   }
54 61
 }
62
+
63
+#endif // ULTIPANEL

Loading…
Cancel
Save