From 644f7e087284a254d024a475e6880f7d03fc40f2 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 26 Dec 2023 11:35:27 -0500 Subject: [PATCH] toolhead: Simplify _advance_flush_time() sg_flush_time calculation 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 6e7b5a94..125ad282 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -283,8 +283,9 @@ class ToolHead: def _advance_flush_time(self, flush_time): flush_time = max(flush_time, self.last_flush_time) # Generate steps via itersolve - sg_flush_ceil = max(flush_time, self.print_time - self.kin_flush_delay) - sg_flush_time = min(flush_time + STEPCOMPRESS_FLUSH_TIME, sg_flush_ceil) + sg_flush_want = min(flush_time + STEPCOMPRESS_FLUSH_TIME, + self.print_time - self.kin_flush_delay) + sg_flush_time = max(sg_flush_want, flush_time) for sg in self.step_generators: sg(sg_flush_time) self.last_sg_flush_time = sg_flush_time