Fix strange bug when usb cannot write.

In this case, the buffer is kept until the next success call.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2022-09-29 23:11:49 +02:00
parent d0fe447416
commit 8f14db677e
2 changed files with 23 additions and 15 deletions

View File

@@ -54,7 +54,7 @@ uint32_t usb_write_offset(uint16_t len, uint16_t offset) {
w = driver_write(tx_buffer+offset, MIN(len, pkt_max));
w_len -= w;
tx_r_offset += w;
return MIN(w_len, pkt_max);
return w;
}
size_t usb_rx(const uint8_t *buffer, size_t len) {