stepper: Implement active callbacks via motion_queuing.register_flush_callback()

Use the existing register_flush_callback() system to implement motor
activity checking.  This simplifies the generate_steps() code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-08-05 14:50:36 -04:00
parent b5e573957c
commit c454e88d9a
4 changed files with 29 additions and 14 deletions

View File

@@ -124,8 +124,8 @@ class MCU_queued_pwm:
value = 1. - value
v = int(max(0., min(1., value)) * self._pwm_max + 0.5)
self._send_update(clock, v)
def _flush_notification(self, print_time):
clock = self._mcu.print_time_to_clock(print_time)
def _flush_notification(self, must_flush_time, max_step_gen_time):
clock = self._mcu.print_time_to_clock(must_flush_time)
if self._last_value != self._default_value:
while clock >= self._last_clock + self._duration_ticks:
self._send_update(self._last_clock + self._duration_ticks,