mirror of https://github.com/Desuuuu/klipper.git
tmc: Allow more retries on a TMC UART read error during background checks
Allow three retries if we can't contact the TMC driver at all when it is in UART mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
a1a7b5e480
commit
c9b81e698e
|
@ -109,7 +109,16 @@ class TMCErrorCheck:
|
||||||
last_value, reg_name, mask, err_mask = reg_info
|
last_value, reg_name, mask, err_mask = reg_info
|
||||||
count = 0
|
count = 0
|
||||||
while 1:
|
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:
|
if val & mask != last_value & mask:
|
||||||
fmt = self.fields.pretty_format(reg_name, val)
|
fmt = self.fields.pretty_format(reg_name, val)
|
||||||
logging.info("TMC '%s' reports %s", self.stepper_name, fmt)
|
logging.info("TMC '%s' reports %s", self.stepper_name, fmt)
|
||||||
|
|
Loading…
Reference in New Issue