From f4e13afa84ebc83451d46b2e0ef005e978e1af54 Mon Sep 17 00:00:00 2001 From: Lephe Date: Sat, 4 Mar 2023 10:59:06 +0100 Subject: [PATCH] usb: fix a missing PIPESEL access This resulted in a random PIPECFG access. --- src/usb/pipes.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/usb/pipes.c b/src/usb/pipes.c index 02ab5cf..511b0f5 100644 --- a/src/usb/pipes.c +++ b/src/usb/pipes.c @@ -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); }