From: Uwe Bonnes Date: Thu, 9 Sep 2010 20:10:47 +0000 (+0200) Subject: EEPROM: CBUS functions only work on TYPE_R devices X-Git-Tag: v1.0rc1~133^2~109 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=07851949856f2d82e71ce5be0c62f8f51d5cd506 EEPROM: CBUS functions only work on TYPE_R devices --- diff --git a/src/ftdi.c b/src/ftdi.c index 440ff54..9d5be1b 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2638,15 +2638,15 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size, { // Addr 0B: Invert data lines // Works only on FT232R, not FT245R, but no way to distinguish - if (ftdi->type == TYPE_R) { - eeprom->cbus_function[0] = buf[0x14] & 0x0f; - eeprom->cbus_function[1] = (buf[0x14] >> 4) & 0x0f; - eeprom->cbus_function[2] = buf[0x15] & 0x0f; - eeprom->cbus_function[3] = (buf[0x15] >> 4) & 0x0f; - eeprom->cbus_function[4] = buf[0x16] & 0x0f; - } else { - for (j=0; j<5; j++) eeprom->cbus_function[j] = 0; - } + eeprom->invert = buf[0x0B]; + // Addr 14: CBUS function: CBUS0, CBUS1 + // Addr 15: CBUS function: CBUS2, CBUS3 + // Addr 16: CBUS function: CBUS5 + eeprom->cbus_function[0] = buf[0x14] & 0x0f; + eeprom->cbus_function[1] = (buf[0x14] >> 4) & 0x0f; + eeprom->cbus_function[2] = buf[0x15] & 0x0f; + eeprom->cbus_function[3] = (buf[0x15] >> 4) & 0x0f; + eeprom->cbus_function[4] = buf[0x16] & 0x0f; } else if (ftdi->type == TYPE_2232H) {