mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-11 07:02:41 +00:00
trezorhal/usb: do not send full packets
This commit is contained in:
parent
f7d72741fd
commit
ecd5fd858b
@ -408,8 +408,9 @@ static uint8_t usb_vcp_class_sof(USBD_HandleTypeDef *dev, usb_vcp_state_t *state
|
|||||||
// Read from the tx ring buffer
|
// Read from the tx ring buffer
|
||||||
usb_rbuf_t *b = &state->tx_ring;
|
usb_rbuf_t *b = &state->tx_ring;
|
||||||
uint8_t *buf = state->tx_packet;
|
uint8_t *buf = state->tx_packet;
|
||||||
size_t len = state->max_packet_len;
|
// We avoid sending full packets as they stall the hosts pipeline, see:
|
||||||
size_t mask = b->cap - 1;
|
// <http://www.cypress.com/?id=4&rID=92719>
|
||||||
|
size_t len = state->max_packet_len - 1;
|
||||||
size_t i;
|
size_t i;
|
||||||
for (i = 0; (i < len) && !ring_empty(b); i++) {
|
for (i = 0; (i < len) && !ring_empty(b); i++) {
|
||||||
buf[i] = b->buf[b->read & mask];
|
buf[i] = b->buf[b->read & mask];
|
||||||
|
Loading…
Reference in New Issue
Block a user