From 80194a7e1823c2d70708767e6cdbec2780aa90b8 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 6 Jun 2019 18:14:45 -0400 Subject: endstop_phase: Fix endstop_phase on trinamic drivers that aren't inverted Signed-off-by: Kevin O'Connor --- klippy/extras/endstop_phase.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'klippy/extras/endstop_phase.py') 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 -- cgit v1.2.3-70-g09d2