diff options
author | Francois Chagnon <fc@francoischagnon.net> | 2023-12-30 11:34:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-30 11:34:21 -0500 |
commit | d7f6348ae6e45e4b566d10974b10ab4bb111222b (patch) | |
tree | 8499e6a9404c0240f44a70f15d4c547db498d993 /klippy/mcu.py | |
parent | b502558052f40339baa04fcfcbbeb65aa77dc1d8 (diff) | |
download | kutter-d7f6348ae6e45e4b566d10974b10ab4bb111222b.tar.gz kutter-d7f6348ae6e45e4b566d10974b10ab4bb111222b.tar.xz kutter-d7f6348ae6e45e4b566d10974b10ab4bb111222b.zip |
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 <fc@francoischagnon.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r-- | klippy/mcu.py | 7 |
1 files changed, 5 insertions, 2 deletions
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,)) |