瀏覽代碼

Move M301 to cpp

Scott Lahteine 7 年之前
父節點
當前提交
609c4eea32
共有 3 個文件被更改,包括 12 次插入10 次删除
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 10
    1
      Marlin/src/gcode/config/M301.cpp
  3. 2
    5
      Marlin/src/gcode/gcode.cpp

+ 0
- 4
Marlin/src/Marlin.cpp 查看文件

@@ -352,10 +352,6 @@ bool pin_is_protected(const int8_t pin) {
352 352
   return false;
353 353
 }
354 354
 
355
-#if ENABLED(PIDTEMP)
356
-  #include "gcode/config/M301.h"
357
-#endif
358
-
359 355
 #if ENABLED(PIDTEMPBED)
360 356
   #include "gcode/config/M304.h"
361 357
 #endif

Marlin/src/gcode/config/M301.h → Marlin/src/gcode/config/M301.cpp 查看文件

@@ -20,6 +20,13 @@
20 20
  *
21 21
  */
22 22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(PIDTEMP)
26
+
27
+#include "../gcode.h"
28
+#include "../../module/temperature.h"
29
+
23 30
 /**
24 31
  * M301: Set PID parameters P I D (and optionally C, L)
25 32
  *
@@ -32,7 +39,7 @@
32 39
  *   C[float] Kc term
33 40
  *   L[float] LPQ length
34 41
  */
35
-void gcode_M301() {
42
+void GcodeSuite::M301() {
36 43
 
37 44
   // multi-extruder PID patch: M301 updates or prints a single extruder's PID values
38 45
   // default behaviour (omitting E parameter) is to update for extruder 0 only
@@ -67,3 +74,5 @@ void gcode_M301() {
67 74
     SERIAL_ERRORLN(MSG_INVALID_EXTRUDER);
68 75
   }
69 76
 }
77
+
78
+#endif // PIDTEMP

+ 2
- 5
Marlin/src/gcode/gcode.cpp 查看文件

@@ -121,7 +121,6 @@ extern void gcode_M164();
121 121
 extern void gcode_M165();
122 122
 extern void gcode_M240();
123 123
 extern void gcode_M250();
124
-extern void gcode_M301();
125 124
 extern void gcode_M302();
126 125
 extern void gcode_M304();
127 126
 extern void gcode_M350();
@@ -570,10 +569,8 @@ void GcodeSuite::process_next_command() {
570 569
       #endif
571 570
 
572 571
       #if ENABLED(PIDTEMP)
573
-        case 301: // M301: Set hotend PID parameters
574
-          gcode_M301();
575
-          break;
576
-      #endif // PIDTEMP
572
+        case 301: M301(); break;  // M301: Set hotend PID parameters
573
+      #endif
577 574
 
578 575
       #if ENABLED(PIDTEMPBED)
579 576
         case 304: // M304: Set bed PID parameters

Loading…
取消
儲存