Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix msd extraneus bytes on reading #2245

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/portable/renesas/rusb2/dcd_rusb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,13 @@ static void pipe_read_packet_ff(rusb2_reg_t * rusb, tu_fifo_t *f, volatile void
tu_fifo_advance_write_pointer(f, count);
}


static void wait_pipe_fifo_empty(rusb2_reg_t* rusb, uint8_t num) {
kkitayam marked this conversation as resolved.
Show resolved Hide resolved
TU_ASSERT(num);
while( (rusb->PIPE_CTR[num-1] & RUSB2_PIPE_CTR_INBUFM_Msk) > 0 ) {}
}


//--------------------------------------------------------------------+
// Pipe Transfer
//--------------------------------------------------------------------+
Expand Down Expand Up @@ -339,6 +346,7 @@ static bool pipe_xfer_in(rusb2_reg_t* rusb, unsigned num)
const unsigned rem = pipe->remaining;

if (!rem) {
wait_pipe_fifo_empty(rusb, num);
pipe->buf = NULL;
return true;
}
Expand Down
Loading