Browse Source

Move M113 to cpp

pull/1/head
Scott Lahteine 7 years ago
parent
commit
14a5d2a273
  1. 4
      Marlin/src/Marlin.cpp
  2. 5
      Marlin/src/gcode/gcode.cpp
  3. 16
      Marlin/src/gcode/host/M113.cpp

4
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"

5
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

16
Marlin/src/gcode/host/M113.h → 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<seconds> 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
Loading…
Cancel
Save