From ed9dee46022543e1778278e30ae74df18f714d3a Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 8 Jan 2018 10:55:37 -0500 Subject: [PATCH] mcu: Only report an MCU timeout once Don't flood the log with timeout messages. Signed-off-by: Kevin O'Connor --- klippy/mcu.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/klippy/mcu.py b/klippy/mcu.py index 136b3bc8..2aa8a0f8 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -431,7 +431,7 @@ class MCU: 'restart_method', rmethods, 'arduino') self._reset_cmd = self._config_reset_cmd = None self._emergency_stop_cmd = None - self._is_shutdown = False + self._is_shutdown = self._is_timeout = False self._shutdown_msg = "" if printer.bglogger is not None: printer.bglogger.set_rollover_info(self._name, None) @@ -727,8 +727,10 @@ class MCU: return offset, freq = self._clocksync.calibrate_clock(print_time, eventtime) self._ffi_lib.steppersync_set_time(self._steppersync, offset, freq) - if self._clocksync.is_active(eventtime) or self.is_fileoutput(): + if (self._clocksync.is_active(eventtime) or self.is_fileoutput() + or self._is_timeout): return + self._is_timeout = True logging.info("Timeout with MCU '%s' (eventtime=%f)", self._name, eventtime) self._printer.invoke_shutdown("Lost communication with MCU '%s'" % (