X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=b5cb4f35d3dc8d72c34827797d0ad7e5aa0dd84e;hp=ca52acd1922bcb2f593e308cd0c6e1d3e66770aa;hb=5a1dcd55de579d5898f30e74f103e5f92156d0ad;hpb=5a2b51cb86894116e7452c330a2afb4ceaf14adc diff --git a/src/ftdi.c b/src/ftdi.c index ca52acd..b5cb4f3 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -1532,19 +1532,19 @@ int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output) output[0x07] = 0x02; // Addr 08: Config descriptor - // Bit 1: remote wakeup if 1 - // Bit 0: self powered if 1 - // - j = 0; +    // Bit 7: always 1 +    // Bit 6: 1 if this device is self powered, 0 if bus powered +    // Bit 5: 1 if this device uses remote wakeup +    // Bit 4: 1 if this device is battery powered + j = 0x80; if (eeprom->self_powered == 1) - j = j | 1; + j |= 0x40; if (eeprom->remote_wakeup == 1) - j = j | 2; + j |= 0x20; output[0x08] = j; // Addr 09: Max power consumption: max power = value * 2 mA output[0x09] = eeprom->max_power; - ; // Addr 0A: Chip configuration // Bit 7: 0 - reserved