X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=07687e81d7f6bb7f8256b72323fe2d328ab9f3ad;hp=8650be25da1da8b0230c9e3aca830f0e3a865eaf;hb=a7c32c59a04044e70612b3ea598ab51b2cff3174;hpb=be4bae37b3f851d7e06610fe474d84a3b2371efb diff --git a/src/ftdi.c b/src/ftdi.c index 8650be2..07687e8 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2577,7 +2577,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) output[0x08] = j; // Addr 09: Max power consumption: max power = value * 2 mA - output[0x09] = eeprom->max_power>>1; + output[0x09] = eeprom->max_power / MAX_POWER_MILLIAMP_PER_UNIT; if (ftdi->type != TYPE_AM) { @@ -3048,7 +3048,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) eeprom->remote_wakeup = buf[0x08] & 0x20; // Addr 09: Max power consumption: max power = value * 2 mA - eeprom->max_power = buf[0x09]; + eeprom->max_power = MAX_POWER_MILLIAMP_PER_UNIT * buf[0x09]; // Addr 0A: Chip configuration // Bit 7: 0 - reserved @@ -3264,7 +3264,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) if (eeprom->self_powered) fprintf(stdout, "Self-Powered%s", (eeprom->remote_wakeup)?", USB Remote Wake Up\n":"\n"); else - fprintf(stdout, "Bus Powered: %3d mA%s", eeprom->max_power * 2, + fprintf(stdout, "Bus Powered: %3d mA%s", eeprom->max_power, (eeprom->remote_wakeup)?" USB Remote Wake Up\n":"\n"); if (eeprom->manufacturer) fprintf(stdout, "Manufacturer: %s\n",eeprom->manufacturer);