summaryrefslogtreecommitdiff
path: root/utils/hwstub/lib/hwstub.cpp
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2016-12-12 11:23:20 +0100
committerGerrit Rockbox <gerrit@rockbox.org>2016-12-12 11:35:16 +0100
commit8e82839fe29c8f5d5180a0cd9e7561c0d74dfabe (patch)
treebbddfb2b51acf151d90019a1bdcea16680d1f782 /utils/hwstub/lib/hwstub.cpp
parent5b52ff2c93befe5fe86920bb8d9a68e7f0f5cee5 (diff)
downloadrockbox-8e82839fe29c8f5d5180a0cd9e7561c0d74dfabe.tar.gz
rockbox-8e82839fe29c8f5d5180a0cd9e7561c0d74dfabe.zip
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
Diffstat (limited to 'utils/hwstub/lib/hwstub.cpp')
-rw-r--r--utils/hwstub/lib/hwstub.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/utils/hwstub/lib/hwstub.cpp b/utils/hwstub/lib/hwstub.cpp
index 7c81146c77..9dd2915903 100644
--- a/utils/hwstub/lib/hwstub.cpp
+++ b/utils/hwstub/lib/hwstub.cpp
@@ -444,7 +444,10 @@ error handle::write(uint32_t addr, const void *buf, size_t& sz, bool atomic)
444 size_t xfer = std::min(sz, get_buffer_size()); 444 size_t xfer = std::min(sz, get_buffer_size());
445 err = write_dev(addr, buf, xfer, atomic); 445 err = write_dev(addr, buf, xfer, atomic);
446 if(err != error::SUCCESS) 446 if(err != error::SUCCESS)
447 {
448 sz = cnt;
447 return err; 449 return err;
450 }
448 sz -= xfer; 451 sz -= xfer;
449 bufp += xfer; 452 bufp += xfer;
450 addr += xfer; 453 addr += xfer;