Skip to content

Commit 81b88cf

Browse files
authored
Merge pull request #42 from tom-van/master
fixes for FT2232C
2 parents 684553f + 6438955 commit 81b88cf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spi.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ int spi_open(int nport)
697697
return 0;
698698
}
699699

700-
if (spi_nports == 0 || nport < spi_nports - 1) {
700+
if (spi_nports == 0 || nport >= spi_nports) {
701701
SPI_ERR("No FTDI device found");
702702
goto open_err;
703703
}
@@ -779,7 +779,7 @@ int spi_open(int nport)
779779
* http://developer.intra2net.com/mailarchive/html/libftdi/2011/msg00413.html
780780
* http://jdelfes.blogspot.ru/2014/03/ft232r-bitbang-spi-part-2.html
781781
*
782-
* FT2232C has 128 byte TX and 384 byte RX buffers per channel.
782+
* FT2232C has 384 byte TX+RX buffer per channel.
783783
* FT2232H has 4kB RX and TX buffers per channel.
784784
* FT4232H has 2kB RX and TX buffers per channel.
785785
* FT232H has 1 kB RX and TX buffers.
@@ -798,7 +798,7 @@ int spi_open(int nport)
798798
break;
799799
case TYPE_2232C:
800800
ftdi_type_str = "FT2232C/D";
801-
ftdi_buf_size = 512;
801+
ftdi_buf_size = 384;
802802
break;
803803
case TYPE_R:
804804
ftdi_type_str = "FT232R";

0 commit comments

Comments
 (0)