diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-06 18:14:45 -0400 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-06-21 22:56:16 -0400 |
commit | 80194a7e1823c2d70708767e6cdbec2780aa90b8 (patch) | |
tree | ee36d0ab052d91283c3cdec7e456103088de9a4a /klippy/extras/endstop_phase.py | |
parent | 0b02d7a1f236ae3b2c1cb2c8a4ce16e1788bc100 (diff) | |
download | kutter-80194a7e1823c2d70708767e6cdbec2780aa90b8.tar.gz kutter-80194a7e1823c2d70708767e6cdbec2780aa90b8.tar.xz kutter-80194a7e1823c2d70708767e6cdbec2780aa90b8.zip |
endstop_phase: Fix endstop_phase on trinamic drivers that aren't inverted
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/endstop_phase.py')
-rw-r--r-- | klippy/extras/endstop_phase.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/klippy/extras/endstop_phase.py b/klippy/extras/endstop_phase.py index 20ddd340..c0408262 100644 --- a/klippy/extras/endstop_phase.py +++ b/klippy/extras/endstop_phase.py @@ -66,6 +66,8 @@ class EndstopPhase: msg = "Unable to get stepper %s phase: %s" % (self.name, str(e)) logging.exception(msg) raise homing.EndstopError(msg) + if stepper.is_dir_inverted(): + phase = (self.phases - 1) - phase else: phase = stepper.get_mcu_position() % self.phases self.phase_history[phase] += 1 |