aboutsummaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorAJM <poslathian@poslathian.(none)>2010-06-09 15:52:29 -0400
committerAJM <poslathian@poslathian.(none)>2010-06-09 15:52:29 -0400
commit8afc89be1da70c2776333b3858532c6b753e11ce (patch)
tree35999d67dfd3f31f0d531f849336148f8d6c9daf /support
parenta89cddd05ea3fb09513a8fb96b9cd963efbffab3 (diff)
downloadlibrambutan-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-xsupport/scripts/reset.py8
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()