endstop_phase: Obtain phases directly from stepper microsteps config

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2020-01-05 20:42:34 -05:00
parent 7dcc778b6c
commit 96eba9f2df
6 changed files with 62 additions and 54 deletions

View File

@@ -283,7 +283,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 (1023 - mscnt) >> self.fields.get_field("MRES")
return 1023 - mscnt, 1024
# Helper to configure "stealthchop" mode
def TMCStealthchopHelper(config, mcu_tmc, tmc_freq):