From: Holger Mößinger Date: Fri, 7 Feb 2020 13:38:46 +0000 (+0100) Subject: eeprom: Fix handling of high_current_drive parameter X-Git-Tag: v1.5rc1~9 X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=commitdiff_plain;h=46ed84b384e8cf1d7ae9a9b0758a08419d282a27 eeprom: Fix handling of high_current_drive parameter Additionally fix it up for type R chips. --- diff --git a/src/ftdi.c b/src/ftdi.c index 7234229..e82514e 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -3136,23 +3136,23 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) case TYPE_2232C: output[0x00] = type2bit(eeprom->channel_a_type, TYPE_2232C); - if ( eeprom->channel_a_driver == DRIVER_VCP) + if (eeprom->channel_a_driver == DRIVER_VCP) output[0x00] |= DRIVER_VCP; else output[0x00] &= ~DRIVER_VCP; - if ( eeprom->high_current_a == HIGH_CURRENT_DRIVE) + if (eeprom->high_current_a) output[0x00] |= HIGH_CURRENT_DRIVE; else output[0x00] &= ~HIGH_CURRENT_DRIVE; output[0x01] = type2bit(eeprom->channel_b_type, TYPE_2232C); - if ( eeprom->channel_b_driver == DRIVER_VCP) + if (eeprom->channel_b_driver == DRIVER_VCP) output[0x01] |= DRIVER_VCP; else output[0x01] &= ~DRIVER_VCP; - if ( eeprom->high_current_b == HIGH_CURRENT_DRIVE) + if (eeprom->high_current_b) output[0x01] |= HIGH_CURRENT_DRIVE; else output[0x01] &= ~HIGH_CURRENT_DRIVE; @@ -3180,7 +3180,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) break; case TYPE_R: output[0x00] = type2bit(eeprom->channel_a_type, TYPE_R); - if (eeprom->high_current == HIGH_CURRENT_DRIVE_R) + if (eeprom->high_current) output[0x00] |= HIGH_CURRENT_DRIVE_R; if (eeprom->channel_a_driver == DRIVER_VCP) output[0x00] |= DRIVER_VCP; diff --git a/src/ftdi_i.h b/src/ftdi_i.h index f62795f..1bc740d 100644 --- a/src/ftdi_i.h +++ b/src/ftdi_i.h @@ -93,7 +93,7 @@ struct ftdi_eeprom int cbus_function[10]; /** Select high current drive on R devices. */ int high_current; - /** Select high current drive on A channel (2232C */ + /** Select high current drive on A channel (2232C). */ int high_current_a; /** Select high current drive on B channel (2232C). */ int high_current_b;