From 8afc89be1da70c2776333b3858532c6b753e11ce Mon Sep 17 00:00:00 2001 From: AJM Date: Wed, 9 Jun 2010 15:52:29 -0400 Subject: first approach at modding the reset scheme now we reset from recv bytes. After receiving the DTR/RTS toggle the next byte in from usb is parsed as the program_delay. For now, this just delays the reset for a period to close the serial port gracefully. Later, this delay will perhaps inform the bootloader of how long to live for... --- support/scripts/reset.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/scripts/reset.py b/support/scripts/reset.py index e4d0e99..7594845 100755 --- a/support/scripts/reset.py +++ b/support/scripts/reset.py @@ -2,9 +2,9 @@ import serial import os - +from struct import pack try: - ser = serial.Serial('/dev/maple', baudrate=115200) + ser = serial.Serial('/dev/ttyACM0', baudrate=115200) ser.open() # pull dtr and rts low @@ -13,6 +13,10 @@ try: # toggle DTR ser.setDTR(1) + ser.setDTR(0) + + programDelay = pack("b",35) + ser.write(programDelay) # close ser.close() -- cgit v1.2.3