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:
@@ -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,))
|
||||
|
||||
Reference in New Issue
Block a user