aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/mcu.py
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2018-01-08 10:55:37 -0500
committerKevin O'Connor <kevin@koconnor.net>2018-01-08 10:55:37 -0500
commited9dee46022543e1778278e30ae74df18f714d3a (patch)
tree4a1de7f7a9daba04494da54ba68e815be77bd37a /klippy/mcu.py
parentf183871e286dcb1341791ffcb51479c7969c2c5d (diff)
downloadkutter-ed9dee46022543e1778278e30ae74df18f714d3a.tar.gz
kutter-ed9dee46022543e1778278e30ae74df18f714d3a.tar.xz
kutter-ed9dee46022543e1778278e30ae74df18f714d3a.zip
mcu: Only report an MCU timeout once
Don't flood the log with timeout messages. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r--klippy/mcu.py6
1 files 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'" % (