diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-05-31 18:18:23 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-05-31 18:20:30 -0400 |
commit | ff9543eee2c41befe5945ec7a60d102d03026472 (patch) | |
tree | 2757b897a494aa92c6fa7799fe177e09477e9c73 /klippy/mcu.py | |
parent | 1b1d2adb31122648d8ba28fdbef9f4d2044cc5f5 (diff) | |
download | kutter-ff9543eee2c41befe5945ec7a60d102d03026472.tar.gz kutter-ff9543eee2c41befe5945ec7a60d102d03026472.tar.xz kutter-ff9543eee2c41befe5945ec7a60d102d03026472.zip |
clocksync: Simplify is_active() check
In some rare circumstances it was possible for the host software to
become so busy that it does not transmit a get_clock request for
several seconds. (In particular, this could occur with some complex
calls to coordinate_descent.) If that happened, it was possible for
the code to incorrectly report a "Timeout with MCU" error. Rework the
is_active() check to prevent that.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r-- | klippy/mcu.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index 2209ce4e..dd9df40d 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -690,7 +690,7 @@ class MCU: serialhdl.arduino_reset(self._serialport, self._reactor) def _restart_via_command(self): if ((self._reset_cmd is None and self._config_reset_cmd is None) - or not self._clocksync.is_active(self._reactor.monotonic())): + or not self._clocksync.is_active()): logging.info("Unable to issue reset command on MCU '%s'", self._name) return if self._reset_cmd is None: @@ -739,7 +739,7 @@ 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() or self.is_fileoutput() or self._is_timeout): return self._is_timeout = True |