--
Uwe Bonnes bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 810298fc3d4168f82e3e38e4f02a76cfb212e862 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Jun 2011 15:07:59 +0200
Subject: Fix calculation of the Mode Bitfield
---
src/ftdi.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/ftdi.c b/src/ftdi.c
index 42a42f0..957bed2 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -2532,7 +2532,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
break;
case TYPE_2232C:
- output[0x00] = (1<<(eeprom->channel_a_type)) & 0x7;
+ output[0x00] =
(eeprom->channel_a_type)?((1<<(eeprom->channel_a_type)) & 0x7):0;
if ( eeprom->channel_a_driver == DRIVER_VCP)
output[0x00] |= DRIVER_VCP;
else
@@ -2543,7 +2543,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
else
output[0x00] &= ~HIGH_CURRENT_DRIVE;
- output[0x01] = (1<<(eeprom->channel_b_type)) & 0x7;
+ output[0x01] =
(eeprom->channel_b_type)?((1<<(eeprom->channel_b_type)) & 0x7):0;
if ( eeprom->channel_b_driver == DRIVER_VCP)
output[0x01] |= DRIVER_VCP;
else
@@ -2614,13 +2614,13 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
output[0x16] = eeprom->cbus_function[4];
break;
case TYPE_2232H:
- output[0x00] = (1<<(eeprom->channel_a_type)) & 0x7;
+ output[0x00] =
(eeprom->channel_a_type)?((1<<(eeprom->channel_a_type)) & 0x7):0;
if ( eeprom->channel_a_driver == DRIVER_VCP)
output[0x00] |= DRIVER_VCP;
else
output[0x00] &= ~DRIVER_VCP;
- output[0x01] = (1<<(eeprom->channel_b_type)) & 0x7;
+ output[0x01] =
(eeprom->channel_b_type)?((1<<(eeprom->channel_b_type)) & 0x7):0;
if ( eeprom->channel_b_driver == DRIVER_VCP)
output[0x01] |= DRIVER_VCP;
else
@@ -2679,7 +2679,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi)
fprintf(stderr,"FIXME: Build FT4232H specific EEPROM settings\n");
break;
case TYPE_232H:
- output[0x00] = (1<<(eeprom->channel_a_type)) & 0xf;
+ output[0x00] =
(eeprom->channel_a_type)?((1<<(eeprom->channel_a_type)) & 0xf):0;
if ( eeprom->channel_a_driver == DRIVER_VCP)
output[0x00] |= DRIVER_VCPH;
else
--
1.7.3.4
--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|