summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJonathan Bell <[email protected]>2023-01-24 12:02:32 +0000
committerJonathan Bell <[email protected]>2023-01-24 12:05:32 +0000
commit0d2078d295667ef985675c398db7fd6a893be895 (patch)
tree4fded11fe69668848bb7c1990c2f8fb4fc572be3 /src
parent73b0047efc4cc657a92b356dd9b5046a44277b33 (diff)
rp2040: shuffle hw_endpoint members
Ordering by element size prevents alignment holes, and as a consequence the host mode version of the struct is the same size as device, as pad bytes at the end are used instead.
Diffstat (limited to 'src')
-rw-r--r--src/portable/raspberrypi/rp2040/rp2040_usb.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/portable/raspberrypi/rp2040/rp2040_usb.h b/src/portable/raspberrypi/rp2040/rp2040_usb.h
index 717ec3514..e7fee3e3a 100644
--- a/src/portable/raspberrypi/rp2040/rp2040_usb.h
+++ b/src/portable/raspberrypi/rp2040/rp2040_usb.h
@@ -51,7 +51,7 @@ typedef struct hw_endpoint
// Transfer direction (i.e. IN is rx for host but tx for device)
// allows us to common up transfer functions
bool rx;
-
+
uint8_t ep_addr;
uint8_t next_pid;
@@ -64,17 +64,19 @@ typedef struct hw_endpoint
// Buffer pointer in usb dpram
uint8_t *hw_data_buf;
+ // User buffer in main memory
+ uint8_t *user_buf;
+
// Current transfer information
- bool active;
uint16_t remaining_len;
uint16_t xferred_len;
- // User buffer in main memory
- uint8_t *user_buf;
-
// Data needed from EP descriptor
uint16_t wMaxPacketSize;
+ // Endpoint is in use
+ bool active;
+
// Interrupt, bulk, etc
uint8_t transfer_type;