mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-07-18 04:08:04 -06:00
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>
This commit is contained in:
parent
b502558052
commit
d7f6348ae6
10 changed files with 54 additions and 27 deletions
|
@ -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,))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue