diff options
| author | Zixun LI <[email protected]> | 2026-05-07 11:18:19 +0200 |
|---|---|---|
| committer | Zixun LI <[email protected]> | 2026-05-07 11:18:19 +0200 |
| commit | 89c7075cdf8e72c6732496453f25fdc7ea82814b (patch) | |
| tree | f1363e85ea47d8cfb1b9b67df55be365ac6f737e /src/device/dcd.h | |
| parent | e557f94c721871246ee7ac0761d74e5f8794300f (diff) | |
| parent | 9b1b781c3efb778d7e631d41e44d36c8ee435906 (diff) | |
Merge remote-tracking branch 'tinyusb/master' into midi-host-rx-bufsize-default-and-docs
Diffstat (limited to 'src/device/dcd.h')
| -rw-r--r-- | src/device/dcd.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device/dcd.h b/src/device/dcd.h index 850c37bc2..f861eb258 100644 --- a/src/device/dcd.h +++ b/src/device/dcd.h @@ -219,6 +219,11 @@ TU_ATTR_ALWAYS_INLINE static inline void dcd_event_setup_received(uint8_t rhport event.rhport = rhport; event.event_id = DCD_EVENT_SETUP_RECEIVED; (void) memcpy(&event.setup_received, setup, sizeof(tusb_control_request_t)); + // USB wire format is little-endian. Convert multi-byte fields to host byte order + // so the stack always sees correct values regardless of CPU endianness. + event.setup_received.wValue = tu_le16toh(event.setup_received.wValue); + event.setup_received.wIndex = tu_le16toh(event.setup_received.wIndex); + event.setup_received.wLength = tu_le16toh(event.setup_received.wLength); dcd_event_handler(&event, in_isr); } |
