From bdb85a454917a6e875c77ae12f9fd67961aebfae Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Fri, 17 Sep 2010 01:48:52 -0400 Subject: 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... --- support/scripts/reset.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'support/scripts') 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 -- cgit v1.2.3