1.0/src/ftdi_stream.c: Check for fitting device
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Tue, 21 Jun 2011 14:14:48 +0000 (16:14 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Tue, 28 Jun 2011 14:38:07 +0000 (16:38 +0200)
src/ftdi_stream.c

index 6b5b61c..b949999 100644 (file)
@@ -152,6 +152,13 @@ ftdi_readstream(struct ftdi_context *ftdi,
     int bufferSize = packetsPerTransfer * ftdi->max_packet_size;
     int xferIndex;
     int err = 0;
+
+    /* Only FT2232H and FT232H know about the synchronous FIFO Mode*/
+    if ((ftdi->type != TYPE_2232H) && (ftdi->type != TYPE_232H))
+    {
+        fprintf(stderr,"Device doesn't support synchronous FIFO mode\n");
+        return 1;
+    }
     
     /* We don't know in what state we are, switch to reset*/
     if (ftdi_set_bitmode(ftdi,  0xff, BITMODE_RESET) < 0)