tmc: Track offset between tmc driver and mcu position

Track the offset between driver phase and mcu position.  This offset
should be constant as long as neither the driver nor the mcu is reset.
If the offset ever changes, log a warning.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-08-05 23:21:31 -04:00
parent c2bfeb60aa
commit 06b8169f56
2 changed files with 60 additions and 6 deletions

View file

@ -163,6 +163,7 @@ class MCU_stepper:
if ret:
raise error("Internal error in stepcompress")
self._set_mcu_position(last_pos)
self._mcu.get_printer().send_event("stepper:sync_mcu_position", self)
def set_trapq(self, tq):
ffi_main, ffi_lib = chelper.get_ffi()
if tq is None: