usb: fix a missing PIPESEL access

This resulted in a random PIPECFG access.
This commit is contained in:
Lephe 2023-03-04 10:59:06 +01:00
parent 911691461f
commit f4e13afa84
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495

View file

@ -143,10 +143,12 @@ static void fifo_bind(fifo_t ct, int pipe, int mode)
}
/* RCNT=0 REW=0 DCLRM=reading DREQE=0 MBW=2 BIGEND=1 CURPIPE=pipe */
if(ct == D0F) {
USB.PIPESEL.PIPESEL = pipe;
USB.D0FIFOSEL.word = 0x0900 | (reading << 13) | pipe;
usb_while(!USB.D0FIFOCTR.FRDY || USB.PIPECFG.DIR != mode);
}
if(ct == D1F) {
USB.PIPESEL.PIPESEL = pipe;
USB.D1FIFOSEL.word = 0x0900 | (reading << 13) | pipe;
usb_while(!USB.D1FIFOCTR.FRDY || USB.PIPECFG.DIR != mode);
}