Browse Source

Removed obnoxious prints and exception ignoring so hopefully we will see some more bugs.

pyserial_fix
Scott Petersen 12 years ago
parent
commit
ffa37316bd
1 changed files with 15 additions and 20 deletions
  1. +15
    -20
      pyad2usb/util.py

+ 15
- 20
pyad2usb/util.py View File

@@ -99,7 +99,7 @@ class Firmware(object):
position = 0

except Exception, err:
traceback.print_exc(err) # TEMP
pass

if timeout > 0 and time.time() - start_time > timeout:
raise TimeoutError('Timed out waiting for pattern: {0}'.format(pattern))
@@ -121,22 +121,17 @@ class Firmware(object):
stage_callback(Firmware.STAGE_WAITING)
time.sleep(1)

try:
# Reboot the device and wait for the boot loader.
stage_callback(Firmware.STAGE_BOOT)
dev.write("=")
read_until('!boot', timeout=10.0)

# Get ourselves into the boot loader and wait for indication
# that it's ready for the firmware upload.
stage_callback(Firmware.STAGE_LOAD)
dev.write("=")
read_until('!load', timeout=10.0)

# And finally do the upload.
do_upload()
stage_callback(Firmware.STAGE_DONE)

except TimeoutError, err:
print traceback.print_exc(err) # TEMP
pass
# Reboot the device and wait for the boot loader.
stage_callback(Firmware.STAGE_BOOT)
dev.write("=")
read_until('!boot', timeout=10.0)

# Get ourselves into the boot loader and wait for indication
# that it's ready for the firmware upload.
stage_callback(Firmware.STAGE_LOAD)
dev.write("=")
read_until('!load', timeout=10.0)

# And finally do the upload.
do_upload()
stage_callback(Firmware.STAGE_DONE)

||||||
x
 
000:0
Loading…
Cancel
Save