Fix bad bug

master
Riccardo 2019-06-24 19:16:04 -07:00
parent 6a9ae3b7c3
commit 541f8beee3
1 changed files with 2 additions and 2 deletions

View File

@ -398,9 +398,9 @@ void *USB_ReadPacket(void *dest, uint16_t len) {
uint32_t count32b = (len + 3) / 4;
for ( i = 0; i < count32b; i++) {
dest += 4;
// packed?
*(__attribute__((__packed__)) uint32_t *)dest = USBx_DFIFO(0);
dest += 4;
}
return ((void *)dest);
}
@ -422,8 +422,8 @@ void USB_WritePacket(const uint8_t *src, uint16_t len, uint32_t ep) {
// load the FIFO
for (i = 0; i < count32b; i++) {
src += 4;
USBx_DFIFO(ep) = *((__attribute__((__packed__)) uint32_t *)src);
src += 4;
}
}