mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-01 05:14:06 +08:00
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…
x
Reference in New Issue
Block a user