Skip to content

Commit fcb1208

Browse files
committed
fix weird code in USB_ReadPacket
1 parent b983cc8 commit fcb1208

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

board/drivers/usb.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,12 @@ int current_int0_alt_setting = 0;
394394
// packet read and write
395395

396396
void *USB_ReadPacket(void *dest, uint16_t len) {
397-
398-
void *dest_copy = dest;
397+
uint32_t *dest_copy = (uint32_t *)dest;
399398
uint32_t count32b = (len + 3U) / 4U;
400399

401400
for (uint32_t i = 0; i < count32b; i++) {
402-
// packed?
403-
*(__attribute__((__packed__)) uint32_t *)dest_copy = USBx_DFIFO(0);
404-
dest_copy += 4;
401+
*dest_copy = USBx_DFIFO(0);
402+
dest_copy++;
405403
}
406404
return ((void *)dest_copy);
407405
}

0 commit comments

Comments
 (0)