Skip to content

Commit

Permalink
sw: don't clear OUT buffer during usb_recv
Browse files Browse the repository at this point in the history
If there is data already in the OUT buffer, don't throw it away.

This was necessary when using `epfifo` due to the way it shared OUT and
SETUP packets.  However, it is causing reliability issues with eptri.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
xobs committed Nov 29, 2019
1 parent bd41cbc commit c8872c1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
Binary file removed releases/v2.0.1/hacker-top.dfu
Binary file not shown.
Binary file removed releases/v2.0.1/pvt-top.dfu
Binary file not shown.
3 changes: 0 additions & 3 deletions sw/src/usb-eptri.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,6 @@ void usb_err(uint8_t ep) {

int usb_recv(void *buffer, int buffer_len) {
// Set the OUT response to ACK, since we are in a position to receive data now.
if (out_have) {
usb_ack(0);
}
while (1) {
if (out_have) {
if (buffer_len > out_buffer_length)
Expand Down

0 comments on commit c8872c1

Please sign in to comment.