Better locating of SmartRF Studio 7.
[goodfet] / client / GoodFET.py
index b37b319..de3ce7d 100755 (executable)
@@ -76,6 +76,9 @@ class GoodFET:
         """Open the serial port"""
         # Make timeout None to wait forever, 0 for non-blocking mode.
         
         """Open the serial port"""
         # Make timeout None to wait forever, 0 for non-blocking mode.
         
+        if os.name=='nt' and sys.version.find('64 bit')!=-1:
+            print "WARNING: PySerial requires a 32-bit Python build in Windows.";
+        
         if port is None and os.environ.get("GOODFET")!=None:
             glob_list = glob.glob(os.environ.get("GOODFET"));
             if len(glob_list) > 0:
         if port is None and os.environ.get("GOODFET")!=None:
             glob_list = glob.glob(os.environ.get("GOODFET"));
             if len(glob_list) > 0:
@@ -94,7 +97,7 @@ class GoodFET:
             glob_list = glob.glob("/dev/ttyU0");
             if len(glob_list) > 0:
                 port = glob_list[0];
             glob_list = glob.glob("/dev/ttyU0");
             if len(glob_list) > 0:
                 port = glob_list[0];
-        if os.name=='nt':
+        if port is None and os.name=='nt':
             from scanwin32 import winScan;
             scan=winScan();
             for order,comport,desc,hwid in sorted(scan.comports()):
             from scanwin32 import winScan;
             scan=winScan();
             for order,comport,desc,hwid in sorted(scan.comports()):