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 <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2019-06-09 12:35:54 -04:00
parent d7754a8f93
commit 61fc57e659
1 changed files with 3 additions and 2 deletions

View File

@ -316,7 +316,6 @@ class ToolHead:
self.print_stall += 1 self.print_stall += 1
self.idle_flush_print_time = 0. self.idle_flush_print_time = 0.
self.reactor.update_timer(self.flush_timer, eventtime + 0.100) self.reactor.update_timer(self.flush_timer, eventtime + 0.100)
return
# Check if there are lots of queued moves and stall if so # Check if there are lots of queued moves and stall if so
while 1: while 1:
est_print_time = self.mcu.estimated_print_time(eventtime) est_print_time = self.mcu.estimated_print_time(eventtime)
@ -328,7 +327,9 @@ class ToolHead:
self.need_check_stall = self.reactor.NEVER self.need_check_stall = self.reactor.NEVER
return return
eventtime = self.reactor.pause(eventtime + min(1., stall_time)) 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): def _flush_handler(self, eventtime):
try: try:
print_time = self.print_time print_time = self.print_time