diff options
| author | hathach <[email protected]> | 2025-02-23 22:21:55 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2025-02-24 10:55:03 +0700 |
| commit | 71e046d9ffb6e388052b02f8230de51bfeb5b0ed (patch) | |
| tree | cc536c43b655e0e90238bb6c2e78eb0be63c571e /src/common | |
| parent | b12c8a90125b99b71ab3409c10424d3f8ad0736b (diff) | |
add tuh_midi_descriptor_cb()
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_types.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h index 42ce5fc12..95ee489a6 100644 --- a/src/common/tusb_types.h +++ b/src/common/tusb_types.h @@ -281,7 +281,8 @@ typedef enum { // TODO remove enum { DESC_OFFSET_LEN = 0, - DESC_OFFSET_TYPE = 1 + DESC_OFFSET_TYPE = 1, + DESC_OFFSET_SUBTYPE = 2 }; enum { @@ -570,14 +571,19 @@ TU_ATTR_ALWAYS_INLINE static inline uint8_t const * tu_desc_next(void const* des return desc8 + desc8[DESC_OFFSET_LEN]; } +// get descriptor length +TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_len(void const* desc) { + return ((uint8_t const*) desc)[DESC_OFFSET_LEN]; +} + // get descriptor type TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_type(void const* desc) { return ((uint8_t const*) desc)[DESC_OFFSET_TYPE]; } -// get descriptor length -TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_len(void const* desc) { - return ((uint8_t const*) desc)[DESC_OFFSET_LEN]; +// get descriptor subtype +TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_desc_subtype(void const* desc) { + return ((uint8_t const*) desc)[DESC_OFFSET_SUBTYPE]; } // find descriptor that match byte1 (type) |
