aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/tmc2660.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/extras/tmc2660.py')
-rw-r--r--klippy/extras/tmc2660.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/klippy/extras/tmc2660.py b/klippy/extras/tmc2660.py
index dcffac75..7fd01546 100644
--- a/klippy/extras/tmc2660.py
+++ b/klippy/extras/tmc2660.py
@@ -198,11 +198,14 @@ class MCU_TMC2660_SPI:
self.fields = fields
def get_fields(self):
return self.fields
- def get_register(self, reg_name):
+ def get_register_raw(self, reg_name):
new_rdsel = ReadRegisters.index(reg_name)
reg = self.name_to_reg["DRVCONF"]
if self.printer.get_start_args().get('debugoutput') is not None:
- return 0
+ return {
+ 'data': 0,
+ '#receive_time': .0,
+ }
with self.mutex:
old_rdsel = self.fields.get_field("rdsel")
val = self.fields.set_field("rdsel", new_rdsel)
@@ -212,7 +215,12 @@ class MCU_TMC2660_SPI:
self.spi.spi_send(msg)
params = self.spi.spi_transfer(msg)
pr = bytearray(params['response'])
- return (pr[0] << 16) | (pr[1] << 8) | pr[2]
+ return {
+ 'data': (pr[0] << 16) | (pr[1] << 8) | pr[2],
+ '#receive_time': params['#receive_time'],
+ }
+ def get_register(self, reg_name):
+ return self.get_register_raw(reg_name)['data']
def set_register(self, reg_name, val, print_time=None):
minclock = 0
if print_time is not None: