diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-03-28 02:18:13 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-04-06 05:38:11 +0200 |
| commit | a062baae3837b453f0c05d0730ba465c6d2c2446 (patch) | |
| tree | 403be84c331592af062a14e7a6ac9a538130fc7e | |
| parent | 52c622b1cd02ba13accc84cd57e90b04797f0405 (diff) | |
nrf/usb: fix wrong DMA read size
| -rw-r--r-- | embassy-nrf/src/usb.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/embassy-nrf/src/usb.rs b/embassy-nrf/src/usb.rs index 203f08fc0..2621e65f4 100644 --- a/embassy-nrf/src/usb.rs +++ b/embassy-nrf/src/usb.rs | |||
| @@ -363,7 +363,7 @@ unsafe fn read_dma<T: Instance>(i: usize, buf: &mut [u8]) -> Result<usize, ReadE | |||
| 363 | let regs = T::regs(); | 363 | let regs = T::regs(); |
| 364 | 364 | ||
| 365 | // Check that the packet fits into the buffer | 365 | // Check that the packet fits into the buffer |
| 366 | let size = regs.size.epout[0].read().bits() as usize; | 366 | let size = regs.size.epout[i].read().bits() as usize; |
| 367 | if size > buf.len() { | 367 | if size > buf.len() { |
| 368 | return Err(ReadError::BufferOverflow); | 368 | return Err(ReadError::BufferOverflow); |
| 369 | } | 369 | } |
