From 184ba4080ce8e7bbbd7f055d55622c92e22f6e3d Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 29 Sep 2025 11:31:31 -0400 Subject: [PATCH] toolhead: Flush lookahead on dwell - fix flushing bug after long delays Commit 7ea5f5d2 changed how the lookahead queue is flushed. Previously, the main flush timer would always run while the toolhead was considered in an active state (print_time). After that commit, the flush timer could sleep if there were no steps generated (no call to note_mcu_movequeue_activity() ). This could lead to a situation where a G4 command (or series of commands) could cause the toolhead to be considered in an active state while the flush timer was disabled. The result was that a future command may not be properly flushed (the toolhead would fail to transition to a "Priming" state). Fix by ensuring that all dwell() requests fully flush the lookahead queue. Signed-off-by: Kevin O'Connor --- klippy/toolhead.py | 1 + 1 file changed, 1 insertion(+) diff --git a/klippy/toolhead.py b/klippy/toolhead.py index f54743b0a..a17750d74 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -398,6 +398,7 @@ class ToolHead: self.move(curpos, speed) self.printer.send_event("toolhead:manual_move") def dwell(self, delay): + self._flush_lookahead() next_print_time = self.get_last_move_time() + max(0., delay) self._advance_move_time(next_print_time) self._check_pause()