motion_queuing: Add new module to help with motion queues and flushing

Create a new module to assist with host management of motion queues.
Register all MCU_stepper objects with this module and use the module
for step generation.

All steppers will now automatically generate steps whenever
toolhead._advance_flush_time() is invoked.  It is no longer necessary
for callers to individually call stepper.generate_steps().

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2025-08-04 21:57:45 -04:00
parent 126275d1f4
commit 9399e738bc
17 changed files with 29 additions and 37 deletions

View File

@@ -273,7 +273,8 @@ def PrinterStepper(config, units_in_radians=False):
rotation_dist, steps_per_rotation,
step_pulse_duration, units_in_radians)
# Register with helper modules
for mname in ['stepper_enable', 'force_move', 'motion_report']:
mods = ['stepper_enable', 'force_move', 'motion_report', 'motion_queuing']
for mname in mods:
m = printer.load_object(config, mname)
m.register_stepper(config, mcu_stepper)
return mcu_stepper
@@ -442,9 +443,6 @@ class GenericPrinterRail:
def setup_itersolve(self, alloc_func, *params):
for stepper in self.steppers:
stepper.setup_itersolve(alloc_func, *params)
def generate_steps(self, flush_time):
for stepper in self.steppers:
stepper.generate_steps(flush_time)
def set_trapq(self, trapq):
for stepper in self.steppers:
stepper.set_trapq(trapq)