aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-05-28 03:11:02 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-05-28 03:11:02 -0400
commit484e13cdb56001effbe7b232ba2ee847665ceb83 (patch)
tree0a24be35bdcc728b4172a60455b4fe7ac044544d
parentacf8b5476fe601f17aafc2676b2161de12b72213 (diff)
downloadlibrambutan-484e13cdb56001effbe7b232ba2ee847665ceb83.tar.gz
librambutan-484e13cdb56001effbe7b232ba2ee847665ceb83.zip
Reset with /dev/maple instead of guessing ttys
Change reset to rely on udev to create a /dev/maple device node and use that instead of guessing which tty it is.
-rwxr-xr-xreset.py9
1 files changed, 1 insertions, 8 deletions
diff --git a/reset.py b/reset.py
index ae5d74b..e4d0e99 100755
--- a/reset.py
+++ b/reset.py
@@ -4,14 +4,7 @@ import serial
import os
try:
- 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 = serial.Serial('/dev/maple', baudrate=115200)
ser.open()
# pull dtr and rts low