Browse Source

Move M113 to cpp

Scott Lahteine 7 years ago
parent
commit
14a5d2a273
3 changed files with 13 additions and 12 deletions
  1. 0
    4
      Marlin/src/Marlin.cpp
  2. 1
    4
      Marlin/src/gcode/gcode.cpp
  3. 12
    4
      Marlin/src/gcode/host/M113.cpp

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

374
   return false;
374
   return false;
375
 }
375
 }
376
 
376
 
377
-#if ENABLED(HOST_KEEPALIVE_FEATURE)
378
-  #include "gcode/host/M113.h"
379
-#endif
380
-
381
 #if ENABLED(BARICUDA)
377
 #if ENABLED(BARICUDA)
382
   #if HAS_HEATER_1
378
   #if HAS_HEATER_1
383
     #include "gcode/feature/baricuda/M126.h"
379
     #include "gcode/feature/baricuda/M126.h"

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

124
 extern void gcode_M85();
124
 extern void gcode_M85();
125
 extern void gcode_M92();
125
 extern void gcode_M92();
126
 extern void gcode_M100();
126
 extern void gcode_M100();
127
-extern void gcode_M113();
128
 extern void gcode_M114();
127
 extern void gcode_M114();
129
 extern void gcode_M115();
128
 extern void gcode_M115();
130
 extern void gcode_M117();
129
 extern void gcode_M117();
457
       #endif
456
       #endif
458
 
457
 
459
       #if ENABLED(HOST_KEEPALIVE_FEATURE)
458
       #if ENABLED(HOST_KEEPALIVE_FEATURE)
460
-        case 113: // M113: Set Host Keepalive interval
461
-          gcode_M113();
462
-          break;
459
+        case 113: M113(); break; // M113: Set Host Keepalive interval
463
       #endif
460
       #endif
464
 
461
 
465
       #if HAS_HEATER_BED && HAS_TEMP_BED
462
       #if HAS_HEATER_BED && HAS_TEMP_BED

Marlin/src/gcode/host/M113.h → Marlin/src/gcode/host/M113.cpp View File

20
  *
20
  *
21
  */
21
  */
22
 
22
 
23
+#include "../../inc/MarlinConfig.h"
24
+
25
+#if ENABLED(HOST_KEEPALIVE_FEATURE)
26
+
27
+#include "../gcode.h"
28
+
23
 /**
29
 /**
24
  * M113: Get or set Host Keepalive interval (0 to disable)
30
  * M113: Get or set Host Keepalive interval (0 to disable)
25
  *
31
  *
26
  *   S<seconds> Optional. Set the keepalive interval.
32
  *   S<seconds> Optional. Set the keepalive interval.
27
  */
33
  */
28
-void gcode_M113() {
34
+void GcodeSuite::M113() {
29
   if (parser.seenval('S')) {
35
   if (parser.seenval('S')) {
30
-    gcode.host_keepalive_interval = parser.value_byte();
31
-    NOMORE(gcode.host_keepalive_interval, 60);
36
+    host_keepalive_interval = parser.value_byte();
37
+    NOMORE(host_keepalive_interval, 60);
32
   }
38
   }
33
   else {
39
   else {
34
     SERIAL_ECHO_START();
40
     SERIAL_ECHO_START();
35
-    SERIAL_ECHOLNPAIR("M113 S", (unsigned long)gcode.host_keepalive_interval);
41
+    SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval);
36
   }
42
   }
37
 }
43
 }
44
+
45
+#endif // HOST_KEEPALIVE_FEATURE

Loading…
Cancel
Save