tmc: Use configfile note_valid=False when inspecting stepper step_distance

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-12-13 10:29:32 -05:00
parent 14fd40e3f9
commit 0923450286
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,7 @@ def TMCStealthchopHelper(config, mcu_tmc, tmc_freq):
if velocity: if velocity:
stepper_name = " ".join(config.get_name().split()[1:]) stepper_name = " ".join(config.get_name().split()[1:])
stepper_config = config.getsection(stepper_name) stepper_config = config.getsection(stepper_name)
step_dist = stepper_config.getfloat('step_distance') step_dist = stepper_config.getfloat('step_distance', note_valid=False)
step_dist_256 = step_dist / (1 << fields.get_field("MRES")) step_dist_256 = step_dist / (1 << fields.get_field("MRES"))
threshold = int(tmc_freq * step_dist_256 / velocity + .5) threshold = int(tmc_freq * step_dist_256 / velocity + .5)
fields.set_field("TPWMTHRS", max(0, min(0xfffff, threshold))) fields.set_field("TPWMTHRS", max(0, min(0xfffff, threshold)))