From 6ec7dee07d20de1a58c2c0b103513efb45d7d205 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Tue, 25 Jun 2019 18:15:17 -0400 Subject: 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 --- klippy/extras/tmc_uart.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'klippy/extras/tmc_uart.py') diff --git a/klippy/extras/tmc_uart.py b/klippy/extras/tmc_uart.py index 288fb76d..f5584e8b 100644 --- a/klippy/extras/tmc_uart.py +++ b/klippy/extras/tmc_uart.py @@ -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) -- cgit v1.2.3-70-g09d2