aboutsummaryrefslogtreecommitdiffstats
path: root/klippy
diff options
context:
space:
mode:
Diffstat (limited to 'klippy')
-rw-r--r--klippy/extras/tmc.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/klippy/extras/tmc.py b/klippy/extras/tmc.py
index 6d6e765b..11073e40 100644
--- a/klippy/extras/tmc.py
+++ b/klippy/extras/tmc.py
@@ -109,7 +109,16 @@ class TMCErrorCheck:
last_value, reg_name, mask, err_mask = reg_info
count = 0
while 1:
- val = self.mcu_tmc.get_register(reg_name)
+ try:
+ val = self.mcu_tmc.get_register(reg_name)
+ except self.printer.command_error as e:
+ count += 1
+ if count < 3 and str(e).startswith("Unable to read tmc uart"):
+ # Allow more retries on a TMC UART read error
+ reactor = self.printer.get_reactor()
+ reactor.pause(reactor.monotonic() + 0.050)
+ continue
+ raise
if val & mask != last_value & mask:
fmt = self.fields.pretty_format(reg_name, val)
logging.info("TMC '%s' reports %s", self.stepper_name, fmt)