A set bit means load D2XX driver. Revers logic and names
[libftdi] / src / ftdi.c
index 99daf43..ac0a651 100644 (file)
@@ -2512,17 +2512,23 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
     // Addr 00: Channel A setting
 
     eeprom->channel_a_type   = buf[0x00] & 0x7;
-    eeprom->channel_a_driver = buf[0x00] & DRIVER_VCP;
+    eeprom->high_current     = buf[0x00] & HIGH_CURRENT_DRIVE_R;
+    eeprom->channel_a_driver = buf[0x00] & DRIVER_D2XX;
     eeprom->high_current_a   = buf[0x00] & HIGH_CURRENT_DRIVE;
 
     // Addr 01: Channel B setting
 
     eeprom->channel_b_type   = buf[0x01] & 0x7;
-    eeprom->channel_b_driver = buf[0x01] & DRIVER_VCP;
+    eeprom->channel_b_driver = buf[0x01] & DRIVER_D2XX;
     eeprom->high_current_b   = buf[0x01] & HIGH_CURRENT_DRIVE;
 
     eeprom->suspend_dbus7    = buf[0x01] & SUSPEND_DBUS7;
 
+    if((ftdi->type == TYPE_R) && ((buf[0x01]&0x40) != 0x40))
+        fprintf(stderr,
+                "TYPE_R EEPROM byte[0x01] Bit 6 unexpected Endpoint size. If this happened with the\n"
+                " EEPROM programmed by FTDI tools, please report to libftdi@developer.intra2net.com\n");
+
     // Addr 02: Vendor ID
     eeprom->vendor_id = buf[0x02] + (buf[0x03] << 8);
 
@@ -2557,7 +2563,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
     eeprom->out_is_isochronous = buf[0x0A]&0x02;
     eeprom->suspend_pull_downs = buf[0x0A]&0x04;
     eeprom->use_serial         = buf[0x0A] & USE_SERIAL_NUM;
-    if((buf[0x0A]&0x10) != 0x10)
+    if(buf[0x0A]&0x10)
         fprintf(stderr,
                 "EEPROM byte[0x0a] Bit 4 unexpected set. If this happened with the EEPROM\n"
                 "programmed by FTDI tools, please report to libftdi@developer.intra2net.com\n");
@@ -2716,12 +2722,12 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size,
         if (ftdi->type >= TYPE_2232C)
             fprintf(stdout,"Channel A has Mode %s%s%s\n", 
                     channel_mode[eeprom->channel_a_type],
-                    (eeprom->channel_a_driver)?" VCP":"",
+                    (eeprom->channel_a_driver)?" D2XX":"",
                     (eeprom->high_current_a)?" High Currenr IO":"");
         if (ftdi->type >= TYPE_2232C)
             fprintf(stdout,"Channel B has Mode %s%s%s\n", 
                     channel_mode[eeprom->channel_b_type],
-                    (eeprom->channel_b_driver)?" VCP":"",
+                    (eeprom->channel_b_driver)?" D2XX":"",
                     (eeprom->high_current_b)?" High Currenr IO":"");
         if ((ftdi->type == TYPE_2232H) || (ftdi->type == TYPE_4232H)) 
         {