From f2cd9fd5d8cac4ca8c94e4f5e6560b4967c87be5 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Wed, 8 Sep 2010 16:02:48 +0200 Subject: [PATCH] For EEPROM decoding, use the evaluated EEPROM size. FT223R is special case, as the EEPROM holds more information than is used for the checksum --- src/ftdi.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) 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; -- 1.7.1