mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-15 20:42:23 +00:00
Merge pull request #1227 from kkitayam/fix_dcd_musb_buffer_overrun
Fix buffer overrun in dcd_musb driver
This commit is contained in:
commit
f8288be03f
@ -250,12 +250,12 @@ static void pipe_read_packet(void *buf, volatile void *fifo, unsigned len)
|
||||
len -= 4;
|
||||
}
|
||||
if (len >= 2) {
|
||||
*(uint32_t *)addr = reg->u16;
|
||||
*(uint16_t *)addr = reg->u16;
|
||||
addr += 2;
|
||||
len -= 2;
|
||||
}
|
||||
if (len) {
|
||||
*(uint32_t *)addr = reg->u8;
|
||||
*(uint8_t *)addr = reg->u8;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user