diff options
author | bnewbold <bnewbold@robocracy.org> | 2010-05-26 23:29:20 -0400 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2010-05-26 23:29:20 -0400 |
commit | c99212c5dea4d26f154731a90abd77e9ea70a917 (patch) | |
tree | 5c5b382dc12000962fa250d4c306f126c0360669 | |
parent | 974910aa4e4ef123ff67e7100f815419956ff7c8 (diff) | |
download | librambutan-c99212c5dea4d26f154731a90abd77e9ea70a917.tar.gz librambutan-c99212c5dea4d26f154731a90abd77e9ea70a917.zip |
cleaned up commit process
-rw-r--r-- | Makefile | 4 | ||||
-rwxr-xr-x | reset.py | 12 | ||||
-rwxr-xr-x | wait.py | 7 |
3 files changed, 11 insertions, 12 deletions
@@ -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 @@ -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" |