diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 14:59:13 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-18 14:59:13 +0200 |
| commit | 87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4 (patch) | |
| tree | b0b8c74bb757abc47a19038c815e5196d31048ff | |
| parent | 9c965c88b4a0aeb69b3523af8ce7c83e284022f9 (diff) | |
| download | rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.zip rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.tar.gz rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.tar.bz2 rockbox-87b84c07d722d6f1fcb8a5d1d7e8549cf17bb8f4.tar.xz | |
sbtools: fix sbloader (allow transfer size override)
Change-Id: Id6d3188b7f837726c29845f01b0b1588acf40407
| -rw-r--r-- | utils/imxtools/sbtools/sbloader.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/imxtools/sbtools/sbloader.c b/utils/imxtools/sbtools/sbloader.c index 01b9fe6..91c0178 100644 --- a/utils/imxtools/sbtools/sbloader.c +++ b/utils/imxtools/sbtools/sbloader.c @@ -311,7 +311,7 @@ static int probe_hid_xfer_size(libusb_device_handle *dev) sizeof(buffer), 1000); if(ret <= 0) goto Lerr; - /* this is not a real parse, since the HID descriptor of the device is + /* this is not a real parser, since the HID descriptor of the device is * is mostly trivial, we assume that all reports are made up of one item * and simply compute the maximum of report size * report count */ int xfer_size = 0; @@ -364,6 +364,7 @@ int main(int argc, char **argv) .dev_type = PROBE_DEVICE}; int usb_bus = -1; int usb_dev = -1; + int force_xfer_size = 0; /* parse command line */ while(1) { @@ -390,7 +391,7 @@ int main(int argc, char **argv) case 'x': { char *end; - di.xfer_size = strtoul(optarg, &end, 0); + force_xfer_size = strtoul(optarg, &end, 0); if(*end) { printf("Invalid transfer size!\n"); @@ -506,6 +507,8 @@ int main(int argc, char **argv) dev_type = g_dev_info[db_idx].dev_type; xfer_size = g_dev_info[db_idx].xfer_size; } + if(force_xfer_size > 0) + xfer_size = force_xfer_size; if(dev_type == PROBE_DEVICE) dev_type = probe_protocol(dev); if(xfer_size == 0) |