X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=c9492f56124a78ad0a7bdb24df9269bfbdb959e5;hp=aa852781324d641cc8df0105042ac992ae182d6d;hb=d45d6648ad017652e18aefc65c1300c5392b2f8e;hpb=c6b94478680a22e4659431773f67e361fb6c527c diff --git a/src/ftdi.c b/src/ftdi.c index aa85278..c9492f5 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -105,6 +105,7 @@ int ftdi_init(struct ftdi_context *ftdi) if (eeprom == 0) ftdi_error_return(-2, "Can't malloc struct ftdi_eeprom"); + memset(eeprom, 0, sizeof(struct ftdi_eeprom); ftdi->eeprom = eeprom; /* All fine. Now allocate the readbuffer */ @@ -2214,7 +2215,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * manufacturer, eeprom->usb_version = 0x0101; else eeprom->usb_version = 0x0200; - eeprom->max_power = 50; + eeprom->max_power = 100; if (eeprom->manufacturer) free (eeprom->manufacturer); @@ -2248,7 +2249,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * manufacturer, if(ftdi->type == TYPE_R) { - eeprom->max_power = 45; + eeprom->max_power = 90; eeprom->size = 0x80; eeprom->cbus_function[0] = CBUS_TXLED; eeprom->cbus_function[1] = CBUS_RXLED; @@ -2586,6 +2587,11 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) else output[0x01] &= ~SUSPEND_DBUS7; + if (eeprom->suspend_pull_downs == 1) + output[0x0A] |= 0x4; + else + output[0x0A] &= ~0x4; + if(eeprom->group0_drive > DRIVE_16MA) output[0x0c] |= DRIVE_16MA; else