From d7f6348ae6e45e4b566d10974b10ab4bb111222b Mon Sep 17 00:00:00 2001 From: Francois Chagnon Date: Sat, 30 Dec 2023 11:34:21 -0500 Subject: toolhead: Keep stepcompress move history relative to current time (#6439) Expire history relative to current time rather than last move in history queue Signed-off-by: Francois Chagnon --- klippy/mcu.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'klippy/mcu.py') diff --git a/klippy/mcu.py b/klippy/mcu.py index 2d8bacc4..ab219cae 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -955,7 +955,7 @@ class MCU: self._reserved_move_slots += 1 def register_flush_callback(self, callback): self._flush_callbacks.append(callback) - def flush_moves(self, print_time): + def flush_moves(self, print_time, clear_history_time): if self._steppersync is None: return clock = self.print_time_to_clock(print_time) @@ -963,7 +963,10 @@ class MCU: return for cb in self._flush_callbacks: cb(print_time, clock) - ret = self._ffi_lib.steppersync_flush(self._steppersync, clock) + clear_history_clock = \ + max(0, self.print_time_to_clock(clear_history_time)) + ret = self._ffi_lib.steppersync_flush(self._steppersync, clock, + clear_history_clock) if ret: raise error("Internal error in MCU '%s' stepcompress" % (self._name,)) -- cgit v1.2.3-70-g09d2