aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-05-26 23:29:20 -0400
committerbnewbold <bnewbold@robocracy.org>2010-05-26 23:29:20 -0400
commitc99212c5dea4d26f154731a90abd77e9ea70a917 (patch)
tree5c5b382dc12000962fa250d4c306f126c0360669
parent974910aa4e4ef123ff67e7100f815419956ff7c8 (diff)
downloadlibrambutan-c99212c5dea4d26f154731a90abd77e9ea70a917.tar.gz
librambutan-c99212c5dea4d26f154731a90abd77e9ea70a917.zip
cleaned up commit process
-rw-r--r--Makefile4
-rwxr-xr-xreset.py12
-rwxr-xr-xwait.py7
3 files changed, 11 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 8bed507..2de5847 100644
--- a/Makefile
+++ b/Makefile
@@ -199,12 +199,12 @@ jtag: $(BUILD_PATH)/main.bin
program_ram: ram
./reset.py
- ./wait.py
+ sleep 1
$(DFU) -a0 -d $(VENDOR_ID):$(PRODUCT_ID) -D build/main.bin -R
program_flash: flash
./reset.py
- ./wait.py
+ sleep 1
$(DFU) -a1 -d $(VENDOR_ID):$(PRODUCT_ID) -D build/main.bin -R
program_jtag: jtag
diff --git a/reset.py b/reset.py
index 020d8cb..ae5d74b 100755
--- a/reset.py
+++ b/reset.py
@@ -1,11 +1,17 @@
#!/usr/bin/python
import serial
-import time
-
+import os
try:
- ser = serial.Serial('/dev/ttyACM0', baudrate=115200)
+ highest = 0
+ # this totally won't work on Mac OSX! /dev/ttySOMETHINGELSE?
+ for f in filter(lambda x: x.startswith('ttyACM'), os.listdir('/dev/')):
+ if (int(f[6:]) > highest):
+ highest = int(f[6:])
+
+ print "Trying /dev/ttyACM%d..." % highest
+ ser = serial.Serial('/dev/ttyACM%d' % highest, baudrate=115200)
ser.open()
# pull dtr and rts low
diff --git a/wait.py b/wait.py
deleted file mode 100755
index 3347089..0000000
--- a/wait.py
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/python
-
-import time
-
-time.sleep(1)
-
-print "Done"