mirror of
https://github.com/espressif/esptool.git
synced 2025-10-16 23:06:31 +08:00
fix(read_flash): flush transmit buffer less often to inrease throughput
Closes https://github.com/espressif/esptool/issues/936
This commit is contained in:

committed by
Radim Karniš

parent
17866a56d2
commit
8ce5ed3c2b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -171,8 +171,15 @@ void stub_tx_one_char(char c)
|
||||
#endif // WITH_USB_OTG
|
||||
uart_tx_one_char(c);
|
||||
#if WITH_USB_JTAG_SERIAL
|
||||
static unsigned short transferred_without_flush = 0;
|
||||
if (stub_uses_usb_jtag_serial()){
|
||||
stub_tx_flush();
|
||||
// Defer flushing until we have a (full - 1) packet or a end of packet (0xc0) byte to increase throughput.
|
||||
// Note that deferring flushing until we have a full packet can cause hang-ups on some platforms.
|
||||
++transferred_without_flush;
|
||||
if (c == '\xc0' || transferred_without_flush >= 63) {
|
||||
stub_tx_flush();
|
||||
transferred_without_flush = 0;
|
||||
}
|
||||
}
|
||||
#endif // WITH_USB_JTAG_SERIAL
|
||||
}
|
||||
|
Reference in New Issue
Block a user