Explorar o código

valentyusb: eptri: don't double-advance read buffer

Due to an error, we were double-advancing the FIFO buffer.  The end
result was that the second half of most reads were getting ignored.

This wasn't found during earlier testing because only 64-byte buffers
were tested.

This corrects this error by avoiding double-advancing the buffer.

Signed-off-by: Sean Cross <sean@xobs.io>
Sean Cross %!s(int64=6) %!d(string=hai) anos
pai
achega
26dcc19b18
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/portable/valentyusb/eptri/dcd_eptri.c

+ 1 - 1
src/portable/valentyusb/eptri/dcd_eptri.c

@@ -226,7 +226,7 @@ static void process_rx(void) {
     test_buffer[total_read] = c;
     test_buffer[total_read] = c;
 #endif
 #endif
     total_read++;
     total_read++;
-    if ((rx_buffer_offset[rx_ep] + current_offset) < rx_buffer_max[rx_ep]) {
+    if (current_offset < rx_buffer_max[rx_ep]) {
 #if LOG_USB
 #if LOG_USB
       usb_log[usb_log_offset].data[usb_log[usb_log_offset].size++] = c;
       usb_log[usb_log_offset].data[usb_log[usb_log_offset].size++] = c;
 #endif
 #endif