From: Uwe Bonnes Date: Wed, 8 Sep 2010 14:02:48 +0000 (+0200) Subject: For EEPROM decoding, use the evaluated EEPROM size. FT223R is special case, as the... X-Git-Tag: v1.0rc1~133^2~124 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=f2cd9fd5d8cac4ca8c94e4f5e6560b4967c87be5 For EEPROM decoding, use the evaluated EEPROM size. FT223R is special case, as the EEPROM holds more information than is used for the checksum --- diff --git a/src/ftdi.c b/src/ftdi.c index 36bcf3b..5a27ac3 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2493,14 +2493,17 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size) unsigned char i, j; unsigned short checksum, eeprom_checksum, value; unsigned char manufacturer_size = 0, product_size = 0, serial_size = 0; - int eeprom_size = 128; + int eeprom_size; struct ftdi_eeprom *eeprom; if (ftdi == NULL) ftdi_error_return(-1,"No context"); if (ftdi->eeprom == NULL) ftdi_error_return(-1,"No eeprom"); - + + eeprom_size = ftdi->eeprom->size; + if(ftdi->type == TYPE_R) + eeprom_size = 0x80; eeprom = ftdi->eeprom; #if 0 size_check = eeprom->size;