aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/tmc2208.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-02-20 13:42:16 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-02-27 10:39:46 -0500
commit6e4270fa79628e85b32900f782fc2badf94488f4 (patch)
tree64a30384aef784741ead39bfb0884138bf5f582b /klippy/extras/tmc2208.py
parenta657aab0bf4e201a043527c08c07bcad76eaecff (diff)
downloadkutter-6e4270fa79628e85b32900f782fc2badf94488f4.tar.gz
kutter-6e4270fa79628e85b32900f782fc2badf94488f4.tar.xz
kutter-6e4270fa79628e85b32900f782fc2badf94488f4.zip
tmc: Move SET_TMC_CURRENT command to TMCCommandHelper()
Refactor the tmc driver implementations so that there is a single implementation of the SET_TMC_CURRENT command. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/extras/tmc2208.py')
-rw-r--r--klippy/extras/tmc2208.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/extras/tmc2208.py b/klippy/extras/tmc2208.py
index 31368e3c..5127d61e 100644
--- a/klippy/extras/tmc2208.py
+++ b/klippy/extras/tmc2208.py
@@ -188,13 +188,13 @@ class TMC2208:
self.fields = tmc.FieldHelper(Fields, SignedFields, FieldFormatters)
self.mcu_tmc = tmc_uart.MCU_TMC_uart(config, Registers, self.fields)
# Register commands
- cmdhelper = tmc.TMCCommandHelper(config, self.mcu_tmc)
+ current_helper = tmc2130.TMCCurrentHelper(config, self.mcu_tmc)
+ cmdhelper = tmc.TMCCommandHelper(config, self.mcu_tmc, current_helper)
cmdhelper.setup_register_dump(ReadRegisters, self.read_translate)
# Setup basic register values
self.fields.set_field("pdn_disable", True)
self.fields.set_field("mstep_reg_select", True)
self.fields.set_field("multistep_filt", True)
- tmc2130.TMCCurrentHelper(config, self.mcu_tmc)
mh = tmc.TMCMicrostepHelper(config, self.mcu_tmc)
self.get_microsteps = mh.get_microsteps
self.get_phase = mh.get_phase