test: Add test cases for tmc drivers
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
committed by
KevinOConnor
parent
700e35c6ac
commit
5de9f74525
@@ -350,6 +350,8 @@ class TMC5160:
|
||||
def get_register(self, reg_name):
|
||||
reg = registers[reg_name]
|
||||
self.spi.spi_send([reg, 0x00, 0x00, 0x00, 0x00])
|
||||
if self.printer.get_start_args().get('debugoutput') is not None:
|
||||
return 0
|
||||
params = self.spi.spi_transfer([reg, 0x00, 0x00, 0x00, 0x00])
|
||||
pr = bytearray(params['response'])
|
||||
return (pr[1] << 24) | (pr[2] << 16) | (pr[3] << 8) | pr[4]
|
||||
|
||||
Reference in New Issue
Block a user