From 14a5d2a2736c5e699d0b6f7d5526306b2ae47558 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 16 Sep 2017 22:45:58 -0500 Subject: [PATCH] Move M113 to cpp --- Marlin/src/Marlin.cpp | 4 ---- Marlin/src/gcode/gcode.cpp | 5 +---- Marlin/src/gcode/host/{M113.h => M113.cpp} | 16 ++++++++++++---- 3 files changed, 13 insertions(+), 12 deletions(-) rename Marlin/src/gcode/host/{M113.h => M113.cpp} (76%) diff --git a/Marlin/src/Marlin.cpp b/Marlin/src/Marlin.cpp index 995c6bdd1..613873a37 100644 --- a/Marlin/src/Marlin.cpp +++ b/Marlin/src/Marlin.cpp @@ -374,10 +374,6 @@ bool pin_is_protected(const int8_t pin) { return false; } -#if ENABLED(HOST_KEEPALIVE_FEATURE) - #include "gcode/host/M113.h" -#endif - #if ENABLED(BARICUDA) #if HAS_HEATER_1 #include "gcode/feature/baricuda/M126.h" diff --git a/Marlin/src/gcode/gcode.cpp b/Marlin/src/gcode/gcode.cpp index f9f508ffd..50d6673b1 100644 --- a/Marlin/src/gcode/gcode.cpp +++ b/Marlin/src/gcode/gcode.cpp @@ -124,7 +124,6 @@ extern void gcode_M83(); extern void gcode_M85(); extern void gcode_M92(); extern void gcode_M100(); -extern void gcode_M113(); extern void gcode_M114(); extern void gcode_M115(); extern void gcode_M117(); @@ -457,9 +456,7 @@ void GcodeSuite::process_next_command() { #endif #if ENABLED(HOST_KEEPALIVE_FEATURE) - case 113: // M113: Set Host Keepalive interval - gcode_M113(); - break; + case 113: M113(); break; // M113: Set Host Keepalive interval #endif #if HAS_HEATER_BED && HAS_TEMP_BED diff --git a/Marlin/src/gcode/host/M113.h b/Marlin/src/gcode/host/M113.cpp similarity index 76% rename from Marlin/src/gcode/host/M113.h rename to Marlin/src/gcode/host/M113.cpp index 59b26c7da..97a827de0 100644 --- a/Marlin/src/gcode/host/M113.h +++ b/Marlin/src/gcode/host/M113.cpp @@ -20,18 +20,26 @@ * */ +#include "../../inc/MarlinConfig.h" + +#if ENABLED(HOST_KEEPALIVE_FEATURE) + +#include "../gcode.h" + /** * M113: Get or set Host Keepalive interval (0 to disable) * * S Optional. Set the keepalive interval. */ -void gcode_M113() { +void GcodeSuite::M113() { if (parser.seenval('S')) { - gcode.host_keepalive_interval = parser.value_byte(); - NOMORE(gcode.host_keepalive_interval, 60); + host_keepalive_interval = parser.value_byte(); + NOMORE(host_keepalive_interval, 60); } else { SERIAL_ECHO_START(); - SERIAL_ECHOLNPAIR("M113 S", (unsigned long)gcode.host_keepalive_interval); + SERIAL_ECHOLNPAIR("M113 S", (unsigned long)host_keepalive_interval); } } + +#endif // HOST_KEEPALIVE_FEATURE