diff options
author | Perry Hung <iperry@gmail.com> | 2010-09-17 01:48:52 -0400 |
---|---|---|
committer | Perry Hung <iperry@gmail.com> | 2010-09-17 01:48:52 -0400 |
commit | bdb85a454917a6e875c77ae12f9fd67961aebfae (patch) | |
tree | 52a088a57da26fda58d5a22bb7d64134ca9346db /support | |
parent | f37e717c8a5b8d5aef2c7ff4ac2e853ed7a38d91 (diff) | |
download | librambutan-bdb85a454917a6e875c77ae12f9fd67961aebfae.tar.gz librambutan-bdb85a454917a6e875c77ae12f9fd67961aebfae.zip |
Improve reset reliability on OS X.
The USB reset scheme on OS X is unreliable. Adding a little bit of sleep
seems to make it much more reliable. This will probably do until we get
a chance to rewrite the USB stack and redo the whole auto-reset
scheme...
Diffstat (limited to 'support')
-rwxr-xr-x | support/scripts/reset.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/support/scripts/reset.py b/support/scripts/reset.py index 9be5607..ad26d10 100755 --- a/support/scripts/reset.py +++ b/support/scripts/reset.py @@ -3,6 +3,7 @@ import serial import os import sys +import time from struct import pack def get_maple_device_path(file_prefix): @@ -68,14 +69,20 @@ try: # try to toggle DTR/RTS (old scheme) ser.setRTS(0) + time.sleep(0.01) ser.setDTR(0) + time.sleep(0.01) ser.setDTR(1) + time.sleep(0.01) ser.setDTR(0) # try magic number ser.setRTS(1) + time.sleep(0.01) ser.setDTR(1) + time.sleep(0.01) ser.setDTR(0) + time.sleep(0.01) ser.write("1EAF") # ok we're done here |