From e6effb8f3586e5324fc1f0e0e1926ed5a600cc21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Br=C3=A1zio?= Date: Thu, 19 May 2016 00:13:33 +0100 Subject: [PATCH] Implements S1 argument in M999 --- Marlin/Marlin_main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 5159e20bf..1f15c0980 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -3645,7 +3645,7 @@ inline void gcode_G28() { #if ENABLED(MECHANICAL_PROBE) stow_z_probe(); #endif - + #ifdef Z_PROBE_END_SCRIPT #if ENABLED(DEBUG_LEVELING_FEATURE) if (DEBUGGING(LEVELING)) { @@ -6335,10 +6335,20 @@ inline void gcode_M907() { /** * M999: Restart after being stopped + * + * Default behaviour is to flush the serial buffer and request + * a resend to the host starting on the last N line received. + * + * Sending "M999 S1" will resume printing without flushing the + * existing command buffer. + * */ inline void gcode_M999() { Running = true; lcd_reset_alert_level(); + + if (code_seen('S') && code_value_short() == 1) return; + // gcode_LastN = Stopped_gcode_LastN; FlushSerialRequestResend(); }