From 1efb552bfd097a23651bbb5ad29b6d8eb3bc9ccd Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 13 Jul 2018 17:48:26 +0700 Subject: add ep2drv, rename descriptor offset --- src/common/tusb_common.h | 11 ++++++++--- src/common/tusb_types.h | 4 ++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/common') diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 2b45a50c9..ddfceabdb 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -144,12 +144,17 @@ static inline uint8_t const * descriptor_next(uint8_t const p_desc[]) { - return p_desc + p_desc[DESCRIPTOR_OFFSET_LENGTH]; + return p_desc + p_desc[DESC_OFFSET_LEN]; } -static inline uint8_t descriptor_typeof(uint8_t const p_desc[]) +static inline uint8_t descriptor_type(uint8_t const p_desc[]) { - return p_desc[DESCRIPTOR_OFFSET_TYPE]; + return p_desc[DESC_OFFSET_TYPE]; +} + +static inline uint8_t descriptor_len(uint8_t const p_desc[]) +{ + return p_desc[DESC_OFFSET_LEN]; } //------------- Conversion -------------// diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h index 4b8ef899c..65e7cd999 100644 --- a/src/common/tusb_types.h +++ b/src/common/tusb_types.h @@ -203,8 +203,8 @@ typedef enum }tusb_event_t; enum { - DESCRIPTOR_OFFSET_LENGTH = 0, - DESCRIPTOR_OFFSET_TYPE = 1 + DESC_OFFSET_LEN = 0, + DESC_OFFSET_TYPE = 1 }; enum { -- cgit v1.3.1