From 484e13cdb56001effbe7b232ba2ee847665ceb83 Mon Sep 17 00:00:00 2001 From: Perry Hung Date: Fri, 28 May 2010 03:11:02 -0400 Subject: 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. --- reset.py | 9 +-------- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3