nrf/usb: fix wrong DMA read size
This commit is contained in:
parent
52c622b1cd
commit
a062baae38
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user