diff options
| author | hathach <[email protected]> | 2013-07-01 10:35:37 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-07-01 10:35:37 +0700 |
| commit | a4f7dc1105f2a2f9aa27fdef810024eebbb7f2ba (patch) | |
| tree | 33eb906a997038d36ac32d68e9a3dcac1103c05d /tinyusb/common/common.h | |
| parent | a943cce99110eabeaea98a390a41842a15de715f (diff) | |
add & pass a first few test for cdc host
implement cdch_open_subtask
Diffstat (limited to 'tinyusb/common/common.h')
| -rw-r--r-- | tinyusb/common/common.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h index 63ba26d56..ed543de00 100644 --- a/tinyusb/common/common.h +++ b/tinyusb/common/common.h @@ -101,6 +101,19 @@ //--------------------------------------------------------------------+ #define memclr_(buffer, size) memset(buffer, 0, size) + +static inline uint8_t const * descriptor_next(uint8_t const * p_desc) ATTR_ALWAYS_INLINE ATTR_PURE; +static inline uint8_t const * descriptor_next(uint8_t const * p_desc) +{ + return p_desc + p_desc[DESCRIPTOR_OFFSET_LENGTH]; +} + +static inline uint8_t descriptor_typeof(uint8_t const * p_desc) ATTR_ALWAYS_INLINE ATTR_PURE; +static inline uint8_t descriptor_typeof(uint8_t const * p_desc) +{ + return p_desc[DESCRIPTOR_OFFSET_TYPE]; +} + //------------- Conversion -------------// /// form an uint32_t from 4 x uint8_t static inline uint32_t u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4) ATTR_ALWAYS_INLINE ATTR_CONST; |
