px_uploader.py: increase estimated erase time

The 9 seconds to erase a board probably still come from the FMU-v1 and
Pixhawks with only 1 MB flash. By now, many targets have 2 MB flash and
take a bit longer to erase. Therefore, we can increase the estimated
time a bit and don't need to resort to the timeout notice.
This commit is contained in:
Julian Oes 2019-11-01 17:49:25 +01:00 committed by Daniel Agar
parent d657a4ee83
commit 5491f9b8f9
1 changed files with 5 additions and 5 deletions

View File

@ -405,10 +405,10 @@ class uploader(object):
deadline = time.time() + 30.0
while time.time() < deadline:
# Draw progress bar (erase usually takes about 9 seconds to complete)
usualEraseDuration = 15.0
estimatedTimeRemaining = deadline-time.time()
if estimatedTimeRemaining >= 9.0:
self.__drawProgressBar(label, 30.0-estimatedTimeRemaining, 9.0)
if estimatedTimeRemaining >= usualEraseDuration:
self.__drawProgressBar(label, 30.0-estimatedTimeRemaining, usualEraseDuration)
else:
self.__drawProgressBar(label, 10.0, 10.0)
sys.stdout.write(" (timeout: %d seconds) " % int(deadline-time.time()))