forked from Archive/PX4-Autopilot
px_uploader.py: fix exception on baudrate change
This prevents an exception happening inside the serial stack.
This commit is contained in:
parent
0754e8f8bc
commit
2467297acf
|
@ -546,7 +546,12 @@ class uploader(object):
|
|||
if self.baudrate_flightstack_idx >= len(self.baudrate_flightstack):
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue