Browse Source

Avoid trying to adjust the port timeout once it's open; Windows apparently doesn't like this.

sbg
px4dev 13 years ago
parent
commit
b871d28c6d
  1. 12
      Tools/px_uploader.py

12
Tools/px_uploader.py

@ -172,10 +172,16 @@ class uploader(object): @@ -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
deadline = time.time() + 10
while time.time() < deadline:
try:
self.__getSync()
self.port.timeout = old_timeout
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):

Loading…
Cancel
Save