mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
px_uploader.py: fix exception on baudrate change
This prevents an exception happening inside the serial stack.
This commit is contained in:
@@ -546,7 +546,12 @@ class uploader(object):
|
|||||||
if self.baudrate_flightstack_idx >= len(self.baudrate_flightstack):
|
if self.baudrate_flightstack_idx >= len(self.baudrate_flightstack):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.port.baudrate = self.baudrate_flightstack[self.baudrate_flightstack_idx]
|
try:
|
||||||
|
self.port.baudrate = self.baudrate_flightstack[self.baudrate_flightstack_idx]
|
||||||
|
except serial.SerialException:
|
||||||
|
# Sometimes _configure_port fails
|
||||||
|
time.sleep(0.04)
|
||||||
|
pass
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user