mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 04:21:36 +08:00
Python exception handling from muggenhor
This commit is contained in:
@@ -430,7 +430,7 @@ while True:
|
|||||||
# Windows, don't open POSIX ports
|
# Windows, don't open POSIX ports
|
||||||
if not "/" in port:
|
if not "/" in port:
|
||||||
up = uploader(port, args.baud)
|
up = uploader(port, args.baud)
|
||||||
except:
|
except Exception:
|
||||||
# open failed, rate-limit our attempts
|
# open failed, rate-limit our attempts
|
||||||
time.sleep(0.05)
|
time.sleep(0.05)
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ while True:
|
|||||||
up.identify()
|
up.identify()
|
||||||
print("Found board %x,%x bootloader rev %x on %s" % (up.board_type, up.board_rev, up.bl_rev, port))
|
print("Found board %x,%x bootloader rev %x on %s" % (up.board_type, up.board_rev, up.bl_rev, port))
|
||||||
|
|
||||||
except:
|
except Exception:
|
||||||
# most probably a timeout talking to the port, no bootloader, try to reboot the board
|
# most probably a timeout talking to the port, no bootloader, try to reboot the board
|
||||||
print("attempting reboot on %s..." % port)
|
print("attempting reboot on %s..." % port)
|
||||||
up.send_reboot()
|
up.send_reboot()
|
||||||
|
|||||||
Reference in New Issue
Block a user