소스 검색

Add M113 to get/set Host Keepalive

Scott Lahteine 8 년 전
부모
커밋
e0b0d1eb6b
1개의 변경된 파일22개의 추가작업 그리고 0개의 파일을 삭제
  1. 22
    0
      Marlin/Marlin_main.cpp

+ 22
- 0
Marlin/Marlin_main.cpp 파일 보기

@@ -151,6 +151,7 @@
151 151
  * M110 - Set the current line number
152 152
  * M111 - Set debug flags with S<mask>. See flag bits defined in Marlin.h.
153 153
  * M112 - Emergency stop
154
+ * M113 - Get or set the timeout interval for Host Keepalive "busy" messages
154 155
  * M114 - Output current position to serial port
155 156
  * M115 - Capabilities string
156 157
  * M117 - Display a message on the controller screen
@@ -4385,6 +4386,27 @@ inline void gcode_M111() {
4385 4386
  */
4386 4387
 inline void gcode_M112() { kill(PSTR(MSG_KILLED)); }
4387 4388
 
4389
+#if ENABLED(HOST_KEEPALIVE_FEATURE)
4390
+
4391
+  /**
4392
+   * M113: Get or set Host Keepalive interval (0 to disable)
4393
+   *
4394
+   *   S<seconds> Optional. Set the keepalive interval.
4395
+   */
4396
+  inline void gcode_M113() {
4397
+    if (code_seen('S')) {
4398
+      host_keepalive_interval = (uint8_t)code_value_short();
4399
+      NOMORE(host_keepalive_interval, 60);
4400
+    }
4401
+    else {
4402
+      SERIAL_ECHO_START;
4403
+      SERIAL_ECHOPAIR("M113 S", (unsigned long)host_keepalive_interval);
4404
+      SERIAL_EOL;
4405
+    }
4406
+  }
4407
+
4408
+#endif
4409
+
4388 4410
 #if ENABLED(BARICUDA)
4389 4411
 
4390 4412
   #if HAS_HEATER_1

Loading…
취소
저장