From fcb1208e15c2d8351ef0612e9eec2dc678ced99c Mon Sep 17 00:00:00 2001 From: George Hotz Date: Tue, 9 Jul 2019 15:08:19 -0700 Subject: [PATCH] fix weird code in USB_ReadPacket --- board/drivers/usb.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/board/drivers/usb.h b/board/drivers/usb.h index 9159d1d5387dcb..1beb51c1d12fe5 100644 --- a/board/drivers/usb.h +++ b/board/drivers/usb.h @@ -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); }