when building the eeprom image, use the actual determined eeprom size
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Fri, 10 Sep 2010 19:40:28 +0000 (21:40 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 Sep 2010 13:34:42 +0000 (15:34 +0200)
src/ftdi.c

index 7ae48cb..cbe03d2 100644 (file)
@@ -2273,6 +2273,11 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output)
     if(eeprom->chip == -1)
         ftdi_error_return(-5,"No connected EEPROM or EEPROM Type unknown");
 
+    if ((eeprom->chip == 0x56) || (eeprom->chip == 0x66))
+        eeprom->size = 0x100;
+    else
+        eeprom->size = 0x80;
+
     if (eeprom->manufacturer != NULL)
         manufacturer_size = strlen(eeprom->manufacturer);
     if (eeprom->product != NULL)