Fix for Windows NT machines with non-FTDI serial ports.
[goodfet] / client / GoodFET.py
index b9c35e3..d97fb94 100755 (executable)
@@ -93,10 +93,13 @@ class GoodFET:
             from scanwin32 import winScan;
             scan=winScan();
             for order,comport,desc,hwid in sorted(scan.comports()):
-                if hwid.index('FTDI')==0:
-                    port=comport;
-                    #print "Using FTDI port %s" % port
-                    
+                try:
+                    if hwid.index('FTDI')==0:
+                        port=comport;
+                        #print "Using FTDI port %s" % port
+                except:
+                    #Do nothing.
+                    a=1;
         
         self.serialport = serial.Serial(
             port,
@@ -195,6 +198,10 @@ class GoodFET:
                         print "# DEBUG %s" % self.serialport.read(self.count)
                            elif self.verb==0xFE:
                         print "# DEBUG 0x%x" % struct.unpack(fmt[self.count-1], self.serialport.read(self.count))[0]
+                    elif self.verb==0xFD:
+                        #Do nothing, just wait so there's no timeout.
+                        print "# NOP.";
+                        
                     sys.stdout.flush();
                 else:
                     self.data=self.serialport.read(self.count);