mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-01 02:55:07 +08:00
px_uploader: fix SerialException error
Sometimes right after reboot, we got a `raise SerialException(
msg.errno, "could not open port {}: {}".format(self._port, msg))`.
If this happens now, we will just try again later.
This commit is contained in:
@@ -214,6 +214,10 @@ class uploader(object):
|
|||||||
except OSError:
|
except OSError:
|
||||||
# wait for the port to be ready
|
# wait for the port to be ready
|
||||||
time.sleep(0.04)
|
time.sleep(0.04)
|
||||||
|
except serial.SerialException:
|
||||||
|
# if open fails, try again later
|
||||||
|
time.sleep(0.04)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user