diff options
| author | Fan DANG <[email protected]> | 2026-04-17 18:39:56 +0800 |
|---|---|---|
| committer | Fan DANG <[email protected]> | 2026-04-17 18:39:56 +0800 |
| commit | 5939831f17272571911d089508b458f496a4cc62 (patch) | |
| tree | a12d00a818aa4850440925651d59281bd7b35b98 /src | |
| parent | 41462d2b79d5c7f82ce9e8fa8268b342f3f89a67 (diff) | |
remove duplicated tu_le16toh since we have converted the endian when setup.
Diffstat (limited to 'src')
| -rw-r--r-- | src/class/mtp/mtp_device.c | 2 | ||||
| -rw-r--r-- | src/common/tusb_compiler.h | 2 | ||||
| -rw-r--r-- | src/device/usbd.c | 2 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/class/mtp/mtp_device.c b/src/class/mtp/mtp_device.c index 59096e476..0da984f4a 100644 --- a/src/class/mtp/mtp_device.c +++ b/src/class/mtp/mtp_device.c @@ -321,7 +321,7 @@ bool mtpd_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb_control_request_t .session_id = p_mtp->session_id, .request = request, .buf = p_mtp->control_buf, - .bufsize = tu_le16toh(request->wLength), + .bufsize = request->wLength, }; switch (request->bRequest) { diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h index 4ed14dcfb..a8971c3df 100644 --- a/src/common/tusb_compiler.h +++ b/src/common/tusb_compiler.h @@ -246,8 +246,10 @@ // Endian conversion use well-known host to network (big endian) naming #if defined(__LIT) #define TU_BYTE_ORDER TU_LITTLE_ENDIAN + #define TU_BITFIELD_ORDER TU_BITFIELD_LE #else #define TU_BYTE_ORDER TU_BIG_ENDIAN + #define TU_BITFIELD_ORDER TU_BITFIELD_BE #endif #define TU_BSWAP16(u16) ((unsigned short)_builtin_revw((unsigned long)u16)) diff --git a/src/device/usbd.c b/src/device/usbd.c index 3c14175f6..da0ffb4c6 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -1212,7 +1212,7 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const TU_LOG_USBD(" String[%u]\r\n", desc_index); // String Descriptor always uses the desc set from user - uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, tu_le16toh(p_request->wIndex)); + uint8_t const* desc_str = (uint8_t const*) tud_descriptor_string_cb(desc_index, p_request->wIndex); TU_VERIFY(desc_str); // first byte of descriptor is its size |
