libftdi-git Archives

Subject: A library to talk to FTDI chips branch, ftdi-eeprom-fix-bitflag-handling, updated. v1.4-40-g2a68cf5

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 14 May 2020 23:09:16 +0200 (CEST)
The branch, ftdi-eeprom-fix-bitflag-handling has been updated
       via  2a68cf5675acd010b16d0c8fa87fd40356c59020 (commit)
      from  21cbf07029f382475cabcc157bb2fef339fff4d0 (commit)


- Log -----------------------------------------------------------------
commit 2a68cf5675acd010b16d0c8fa87fd40356c59020
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date:   Thu May 14 23:00:24 2020 +0200

    ftdi_eeprom_build(): Fix inverted handling of VCP driver field for TYPE_R 
chips
    
    From doc/EEPROM-structure:
    
        On TYPE_R 00.3 set mean D2XX, on other devices VCP
    
    -> invert the field for TYPE_R so "eeprom->channel_a_driver"
       set to 1 always means VCP driver for all chips.

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index d86d98e..d527d6f 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -3182,8 +3182,13 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
             output[0x00] = type2bit(eeprom->channel_a_type, TYPE_R);
             if (eeprom->high_current)
                 output[0x00] |= HIGH_CURRENT_DRIVE_R;
+
+            /* Field is inverted for TYPE_R: Bit 00.3 set to 1 is D2XX, VCP is 
0 */
             if (eeprom->channel_a_driver)
+                output[0x00] &= ~DRIVER_VCP;
+            else
                 output[0x00] |= DRIVER_VCP;
+
             if (eeprom->external_oscillator)
                 output[0x00] |= 0x02;
             output[0x01] = 0x40; /* Hard coded Endpoint Size*/


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, ftdi-eeprom-fix-bitflag-handling, updated. v1.4-40-g2a68cf5, libftdi-git <=