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/tmc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'klippy/extras/tmc.py') diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index f3dcdb92..d0c88f58 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -227,7 +227,7 @@ class TMCMicrostepHelper: field_name = "MSTEP" reg = self.mcu_tmc.get_register(self.fields.lookup_register(field_name)) mscnt = self.fields.get_field(field_name, reg) - return mscnt >> self.fields.get_field("MRES") + return (1023 - mscnt) >> self.fields.get_field("MRES") # Helper to configure "stealthchop" mode def TMCStealthchopHelper(config, mcu_tmc, tmc_freq): -- cgit v1.2.3-70-g09d2