diff options
author | AJM <poslathian@poslathian.(none)> | 2010-06-09 15:52:29 -0400 |
---|---|---|
committer | AJM <poslathian@poslathian.(none)> | 2010-06-09 15:52:29 -0400 |
commit | 8afc89be1da70c2776333b3858532c6b753e11ce (patch) | |
tree | 35999d67dfd3f31f0d531f849336148f8d6c9daf /support | |
parent | a89cddd05ea3fb09513a8fb96b9cd963efbffab3 (diff) | |
download | librambutan-8afc89be1da70c2776333b3858532c6b753e11ce.tar.gz librambutan-8afc89be1da70c2776333b3858532c6b753e11ce.zip |
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...
Diffstat (limited to 'support')
-rwxr-xr-x | support/scripts/reset.py | 8 |
1 files changed, 6 insertions, 2 deletions
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() |