diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 18:54:56 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2019-06-21 21:42:20 -0400 |
commit | d98bbc772cb2a605786443d8cf12abce963a07f6 (patch) | |
tree | 7427a349f29d5ca82f4521038a4005ce1ee051c5 /klippy/mcu.py | |
parent | ebb375fee9bafd3910ea77301e199b34a2a58cc6 (diff) | |
download | kutter-d98bbc772cb2a605786443d8cf12abce963a07f6.tar.gz kutter-d98bbc772cb2a605786443d8cf12abce963a07f6.tar.xz kutter-d98bbc772cb2a605786443d8cf12abce963a07f6.zip |
serialhdl: Eventually timeout connect attempt
If the serial connection has not been successful after 2.5 minutes
then report an error.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/mcu.py')
-rw-r--r-- | klippy/mcu.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/klippy/mcu.py b/klippy/mcu.py index cb07658f..2facba0a 100644 --- a/klippy/mcu.py +++ b/klippy/mcu.py @@ -614,8 +614,11 @@ class MCU: and not os.path.exists(self._serialport)): # Try toggling usb power self._check_restart("enable power") - self._serial.connect() - self._clocksync.connect(self._serial) + try: + self._serial.connect() + self._clocksync.connect(self._serial) + except serialhdl.error as e: + raise error(str(e)) msgparser = self._serial.get_msgparser() name = self._name log_info = [ |