mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-11-02 03:16:02 +01:00
tmc: It's not valid to schedule messages with print_time=0
A print_time of zero may translate to a negative clock on a secondary micro-controller, which would cause an internal error. Change the code to pass a real print_time or None if it is not needed. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
@@ -149,8 +149,10 @@ class MCU_TMC_uart_bitbang:
|
||||
params = self.tmcuart_send_cmd.send_with_response(
|
||||
[self.oid, msg, 10], 'tmcuart_response', self.oid)
|
||||
return self._decode_read(reg, params['read'])
|
||||
def reg_write(self, instance_id, addr, reg, val, print_time=0.):
|
||||
minclock = self.mcu.print_time_to_clock(print_time)
|
||||
def reg_write(self, instance_id, addr, reg, val, print_time=None):
|
||||
minclock = 0
|
||||
if print_time is not None:
|
||||
minclock = self.mcu.print_time_to_clock(print_time)
|
||||
if self.analog_mux is not None:
|
||||
self.analog_mux.activate(instance_id)
|
||||
msg = self._encode_write(0xf5, 0x00, reg | 0x80, val)
|
||||
|
||||
Reference in New Issue
Block a user