From 61fc57e659f765680068bddd0d03d6ff637c6c6a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 9 Jun 2019 12:35:54 -0400 Subject: [PATCH] toolhead: Commands should still pause even when sync_print_time If commands are slowly fed to the printer it could cause the number of queued commands to grow without bound. Be sure to pause the incoming command stream even if the lookahead queue is empty. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index 713b0009..64790130 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -316,7 +316,6 @@ class ToolHead: self.print_stall += 1 self.idle_flush_print_time = 0. self.reactor.update_timer(self.flush_timer, eventtime + 0.100) - return # Check if there are lots of queued moves and stall if so while 1: est_print_time = self.mcu.estimated_print_time(eventtime) @@ -328,7 +327,9 @@ class ToolHead: self.need_check_stall = self.reactor.NEVER return eventtime = self.reactor.pause(eventtime + min(1., stall_time)) - self.need_check_stall = est_print_time + self.buffer_time_high + 0.100 + if not self.sync_print_time: + self.need_check_stall = (est_print_time + self.buffer_time_high + + 0.100) def _flush_handler(self, eventtime): try: print_time = self.print_time