fix weird code in USB_ReadPacket

This commit is contained in:
George Hotz 2019-07-09 15:08:19 -07:00
parent b983cc8fe6
commit fcb1208e15
1 changed files with 3 additions and 5 deletions

View File

@ -394,14 +394,12 @@ int current_int0_alt_setting = 0;
// packet read and write
void *USB_ReadPacket(void *dest, uint16_t len) {
void *dest_copy = dest;
uint32_t *dest_copy = (uint32_t *)dest;
uint32_t count32b = (len + 3U) / 4U;
for (uint32_t i = 0; i < count32b; i++) {
// packed?
*(__attribute__((__packed__)) uint32_t *)dest_copy = USBx_DFIFO(0);
dest_copy += 4;
*dest_copy = USBx_DFIFO(0);
dest_copy++;
}
return ((void *)dest_copy);
}