Browse Source

Move M302 to cpp

Scott Lahteine 7 years ago
parent
commit
828405cac8
3 changed files with 12 additions and 10 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 10
    1
      Marlin/src/gcode/config/M302.cpp
  3. 2
    5
      Marlin/src/gcode/gcode.cpp

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

@@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) {
352 352
   return false;
353 353
 }
354 354
 
355
-#if ENABLED(PREVENT_COLD_EXTRUSION)
356
-  #include "gcode/config/M302.h"
357
-#endif
358
-
359 355
 #if ENABLED(MORGAN_SCARA)
360 356
   #include "gcode/scara/M360-M364.h"
361 357
 #endif

Marlin/src/gcode/config/M302.h → Marlin/src/gcode/config/M302.cpp View File

@@ -20,6 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(PREVENT_COLD_EXTRUSION)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/temperature.h"
29
+
23 30
 /**
24 31
  * M302: Allow cold extrudes, or set the minimum extrude temperature
25 32
  *
@@ -35,7 +42,7 @@
35 42
  *       M302 S170    ; only allow extrusion above 170
36 43
  *       M302 S170 P1 ; set min extrude temp to 170 but leave disabled
37 44
  */
38
-void gcode_M302() {
45
+void GcodeSuite::M302() {
39 46
   const bool seen_S = parser.seen('S');
40 47
   if (seen_S) {
41 48
     thermalManager.extrude_min_temp = parser.value_celsius();
@@ -52,3 +59,5 @@ void gcode_M302() {
52 59
     SERIAL_ECHOLNPGM("C)");
53 60
   }
54 61
 }
62
+
63
+#endif // PREVENT_COLD_EXTRUSION

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

@@ -119,7 +119,6 @@ void GcodeSuite::dwell(millis_t time) {
119 119
 extern void gcode_M163();
120 120
 extern void gcode_M164();
121 121
 extern void gcode_M165();
122
-extern void gcode_M302();
123 122
 extern void gcode_M350();
124 123
 extern void gcode_M351();
125 124
 extern void gcode_M355();
@@ -587,10 +586,8 @@ void GcodeSuite::process_next_command() {
587 586
       #endif
588 587
 
589 588
       #if ENABLED(PREVENT_COLD_EXTRUSION)
590
-        case 302: // M302: Allow cold extrudes (set the minimum extrude temperature)
591
-          gcode_M302();
592
-          break;
593
-      #endif // PREVENT_COLD_EXTRUSION
589
+        case 302: M302(); break;  // M302: Allow cold extrudes (set the minimum extrude temperature)
590
+      #endif
594 591
 
595 592
       case 303: // M303: PID autotune
596 593
         M303();

Loading…
Cancel
Save