From 42f52d34b48f98f464cd3f9c194ea36c33b7d43e Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Wed, 6 Feb 2019 11:42:24 +0100 Subject: [PATCH] Flush serial buffer after heating Some hosts like Pronterface use continuous M105 commands to poll temperature, this causes a software halt when the heating via M109 or M190 is finished. Flushing the rx buffer fixes this. As reported in #15, thanks to @rug156 for the feedback! --- Marlin/Marlin_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 0c1d97e..497231c 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -8551,6 +8551,10 @@ inline void gcode_M109() { #if DISABLED(BUSY_WHILE_HEATING) KEEPALIVE_STATE(IN_HANDLER); #endif + + // flush the serial buffer after heating to prevent lockup by m105 + flush_and_request_resend(); + } #if HAS_HEATED_BED