nrf/usb: fix wrong DMA read size

This commit is contained in:
Dario Nieuwenhuis 2022-03-28 02:18:13 +02:00
parent 52c622b1cd
commit a062baae38

View File

@ -363,7 +363,7 @@ unsafe fn read_dma<T: Instance>(i: usize, buf: &mut [u8]) -> Result<usize, ReadE
let regs = T::regs(); let regs = T::regs();
// Check that the packet fits into the buffer // Check that the packet fits into the buffer
let size = regs.size.epout[0].read().bits() as usize; let size = regs.size.epout[i].read().bits() as usize;
if size > buf.len() { if size > buf.len() {
return Err(ReadError::BufferOverflow); return Err(ReadError::BufferOverflow);
} }