summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-06-18 16:36:05 +0700
committerhathach <[email protected]>2026-06-18 16:36:05 +0700
commitedf675f468a9ff7ac8c5e14d41d1060f3296fb2b (patch)
tree2627991aa928486c156b9088577712ef076cce32
parent4498f65c460874ae64306d01638f52285394efc5 (diff)
class/audio: remove unused audio20_control_request_t
After the UAC2 examples switched to tusb_control_request_t with TU_U16_HIGH/LOW() extraction, audio20_control_request_t is no longer referenced anywhere in the tree. It is a byte-overlay of the setup packet whose bChannelNumber/bControlSelector/bInterface/bEntityID sub-byte fields silently misread on big-endian once wValue/wIndex are converted to host order (tu_le16toh in dcd.h), so leaving it in the public header is a latent BE trap; the BE bitfield guard previously added to its bmRequestType_bit only masked that by guarding byte 0. Drop the struct entirely. Callers should use tusb_control_request_t and TU_U16_LOW/HIGH(wValue|wIndex), matching audio_device.c and the examples. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
-rw-r--r--src/class/audio/audio.h31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/class/audio/audio.h b/src/class/audio/audio.h
index d0d50cf5b..428391bb2 100644
--- a/src/class/audio/audio.h
+++ b/src/class/audio/audio.h
@@ -1186,37 +1186,6 @@ typedef struct TU_ATTR_PACKED {
uint16_t wLockDelay; ///< Indicates the time it takes this endpoint to reliably lock its internal clock recovery circuitry. Units used depend on the value of the bLockDelayUnits field.
} audio20_desc_cs_as_iso_data_ep_t;
-// 5.2.2 Control Request Layout
-typedef struct TU_ATTR_PACKED {
- union {
- struct TU_ATTR_PACKED {
-#if (TU_BITFIELD_ORDER == TU_BITFIELD_LE)
- uint8_t recipient : 5;///< Recipient type tusb_request_recipient_t.
- uint8_t type : 2; ///< Request type tusb_request_type_t.
- uint8_t direction : 1;///< Direction type. tusb_dir_t
-#elif (TU_BITFIELD_ORDER == TU_BITFIELD_BE)
- uint8_t direction : 1;///< Direction type. tusb_dir_t
- uint8_t type : 2; ///< Request type tusb_request_type_t.
- uint8_t recipient : 5;///< Recipient type tusb_request_recipient_t.
-#else
- #error "Please define TU_BITFIELD_ORDER as TU_BITFIELD_LE or TU_BITFIELD_BE"
-#endif
- } bmRequestType_bit;
-
- uint8_t bmRequestType;
- };
-
- uint8_t bRequest;///< Request type audio_cs_req_t
- uint8_t bChannelNumber;
- uint8_t bControlSelector;
- union {
- uint8_t bInterface;
- uint8_t bEndpoint;
- };
- uint8_t bEntityID;
- uint16_t wLength;
-} audio20_control_request_t;
-
//// 5.2.3 Control Request Parameter Block Layout
// 5.2.3.1 1-byte Control CUR Parameter Block