Browse Source

Move M302 to cpp

Scott Lahteine 8 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
   return false;
352
   return false;
353
 }
353
 }
354
 
354
 
355
-#if ENABLED(PREVENT_COLD_EXTRUSION)
356
-  #include "gcode/config/M302.h"
357
-#endif
358
-
359
 #if ENABLED(MORGAN_SCARA)
355
 #if ENABLED(MORGAN_SCARA)
360
   #include "gcode/scara/M360-M364.h"
356
   #include "gcode/scara/M360-M364.h"
361
 #endif
357
 #endif

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

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
  * M302: Allow cold extrudes, or set the minimum extrude temperature
31
  * M302: Allow cold extrudes, or set the minimum extrude temperature
25
  *
32
  *
35
  *       M302 S170    ; only allow extrusion above 170
42
  *       M302 S170    ; only allow extrusion above 170
36
  *       M302 S170 P1 ; set min extrude temp to 170 but leave disabled
43
  *       M302 S170 P1 ; set min extrude temp to 170 but leave disabled
37
  */
44
  */
38
-void gcode_M302() {
45
+void GcodeSuite::M302() {
39
   const bool seen_S = parser.seen('S');
46
   const bool seen_S = parser.seen('S');
40
   if (seen_S) {
47
   if (seen_S) {
41
     thermalManager.extrude_min_temp = parser.value_celsius();
48
     thermalManager.extrude_min_temp = parser.value_celsius();
52
     SERIAL_ECHOLNPGM("C)");
59
     SERIAL_ECHOLNPGM("C)");
53
   }
60
   }
54
 }
61
 }
62
+
63
+#endif // PREVENT_COLD_EXTRUSION

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

119
 extern void gcode_M163();
119
 extern void gcode_M163();
120
 extern void gcode_M164();
120
 extern void gcode_M164();
121
 extern void gcode_M165();
121
 extern void gcode_M165();
122
-extern void gcode_M302();
123
 extern void gcode_M350();
122
 extern void gcode_M350();
124
 extern void gcode_M351();
123
 extern void gcode_M351();
125
 extern void gcode_M355();
124
 extern void gcode_M355();
587
       #endif
586
       #endif
588
 
587
 
589
       #if ENABLED(PREVENT_COLD_EXTRUSION)
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
       case 303: // M303: PID autotune
592
       case 303: // M303: PID autotune
596
         M303();
593
         M303();

Loading…
Cancel
Save