aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2023-12-26 11:35:27 -0500
committerKevin O'Connor <kevin@koconnor.net>2023-12-26 11:35:27 -0500
commit644f7e087284a254d024a475e6880f7d03fc40f2 (patch)
tree8450285dbce143f66277598ef5204be6e8b44acb
parentfe56bf36c920546fe27e21fa45be220ac764f67b (diff)
downloadkutter-644f7e087284a254d024a475e6880f7d03fc40f2.tar.gz
kutter-644f7e087284a254d024a475e6880f7d03fc40f2.tar.xz
kutter-644f7e087284a254d024a475e6880f7d03fc40f2.zip
toolhead: Simplify _advance_flush_time() sg_flush_time calculation
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/toolhead.py5
1 files 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