extruder: Make sure to flush steps during sync_stepper()

The stepper positions will only be in sync after the step generation
code has been flushed.  This fixes an "internal error in stepcompress"
error during a SYNC_STEPPER_TO_EXTRUDER command.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-02-26 20:11:39 -05:00
parent c7688c6bca
commit c5a9d7914b
1 changed files with 2 additions and 0 deletions

View File

@ -99,6 +99,8 @@ class PrinterExtruder:
def get_heater(self): def get_heater(self):
return self.heater return self.heater
def sync_stepper(self, stepper): def sync_stepper(self, stepper):
toolhead = self.printer.lookup_object('toolhead')
toolhead.flush_step_generation()
epos = self.stepper.get_commanded_position() epos = self.stepper.get_commanded_position()
stepper.set_position([epos, 0., 0.]) stepper.set_position([epos, 0., 0.])
stepper.set_trapq(self.trapq) stepper.set_trapq(self.trapq)