mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-23 15:07:34 +08:00
Avoid trying to adjust the port timeout once it's open; Windows apparently doesn't like this.
This commit is contained in:
+10
-4
@@ -172,10 +172,16 @@ class uploader(object):
|
||||
self.__send(uploader.CHIP_ERASE
|
||||
+ uploader.EOC)
|
||||
# erase is very slow, give it 10s
|
||||
old_timeout = self.port.timeout
|
||||
self.port.timeout = 10
|
||||
self.__getSync()
|
||||
self.port.timeout = old_timeout
|
||||
deadline = time.time() + 10
|
||||
while time.time() < deadline:
|
||||
try:
|
||||
self.__getSync()
|
||||
return
|
||||
except RuntimeError as ex:
|
||||
# we timed out, that's OK
|
||||
continue
|
||||
|
||||
raise RuntimeError("timed out waiting for erase")
|
||||
|
||||
# send a PROG_MULTI command to write a collection of bytes
|
||||
def __program_multi(self, data):
|
||||
|
||||
Reference in New Issue
Block a user