X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=de696f3229f182bb3b003e116b1541848d717910;hp=aa713d5ac9576c25a4896abc20e9b09ea6970734;hb=564b271685e24105db5c69a10bbc682efd90e919;hpb=642f94997c2614312fb371c6a3712b4c6bc5d0c0 diff --git a/src/ftdi.c b/src/ftdi.c index aa713d5..de696f3 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2610,19 +2610,6 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) } else eeprom->serial = NULL; - // Addr 14: CBUS function: CBUS0, CBUS1 - // Addr 15: CBUS function: CBUS2, CBUS3 - // Addr 16: CBUS function: CBUS5 - 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; - } - // verify checksum checksum = 0xAAAA; @@ -2643,6 +2630,22 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) ftdi_error_return(-1,"EEPROM checksum error"); } + if(ftdi->type == TYPE_R) + { + // Addr 14: CBUS function: CBUS0, CBUS1 + // Addr 15: CBUS function: CBUS2, CBUS3 + // Addr 16: CBUS function: CBUS5 + 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; + } + } + return 0; }