1
0
Fork 0
forked from len0rd/rockbox

hwstub: various cleanups

- hwstub load now properly stops reading the log when the device returns a 0
  size buffer instead of STALLing
- add debug output option to hwstub_load
- correctly report transfered size on write error
- add some debug error message in usb code so that some errors can be diagnosed
  more easily
- add a batch mode to hwstub_shell to disable the interactive shell
- increase usb control timeout to 1sec, 100ms was really tight
- cap usb buffer size to ~4000 bytes because libusb has a hardwired limit of
  4096 bytes for control transfers

Change-Id: Id3200ab99ce70a7a3b09ce7faeaafa4a0fac64c7
This commit is contained in:
Amaury Pouly 2016-12-12 11:23:20 +01:00 committed by Gerrit Rockbox
parent 5b52ff2c93
commit 8e82839fe2
4 changed files with 44 additions and 6 deletions

View file

@ -444,7 +444,10 @@ error handle::write(uint32_t addr, const void *buf, size_t& sz, bool atomic)
size_t xfer = std::min(sz, get_buffer_size());
err = write_dev(addr, buf, xfer, atomic);
if(err != error::SUCCESS)
{
sz = cnt;
return err;
}
sz -= xfer;
bufp += xfer;
addr += xfer;