From f01c8853ca5c4f7d89ea1ae9a33779fe9c0446b1 Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Mon, 13 May 2024 22:31:39 +0200 Subject: tmc: Do not pass the frequency directly to the helpers Use the new get_tmc_frequency() instead. Signed-off-by: Alex Voinea --- klippy/extras/tmc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klippy/extras/tmc.py') diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py index 8143882a..4ce9466a 100644 --- a/klippy/extras/tmc.py +++ b/klippy/extras/tmc.py @@ -592,7 +592,7 @@ def TMCtstepHelper(step_dist, mres, tmc_freq, velocity): return 0xfffff # Helper to configure stealthChop-spreadCycle transition velocity -def TMCStealthchopHelper(config, mcu_tmc, tmc_freq): +def TMCStealthchopHelper(config, mcu_tmc): fields = mcu_tmc.get_fields() en_pwm_mode = False velocity = config.getfloat('stealthchop_threshold', None, minval=0.) @@ -606,7 +606,8 @@ def TMCStealthchopHelper(config, mcu_tmc, tmc_freq): rotation_dist, steps_per_rotation = stepper.parse_step_distance(sconfig) step_dist = rotation_dist / steps_per_rotation mres = fields.get_field("mres") - tpwmthrs = TMCtstepHelper(step_dist, mres, tmc_freq, velocity) + tpwmthrs = TMCtstepHelper(step_dist, mres, mcu_tmc.get_tmc_frequency(), + velocity) fields.set_field("tpwmthrs", tpwmthrs) reg = fields.lookup_register("en_pwm_mode", None) -- cgit v1.2.3-70-g09d2