diff options
| author | hathach <[email protected]> | 2013-02-06 18:12:26 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-02-06 18:12:26 +0700 |
| commit | e6ed1729b252acaf2f4cd551586f942b8ab7549b (patch) | |
| tree | 079578615d314b1519fb6b615e17ab631012f76f /tinyusb/common | |
| parent | 060c4b3b302f349d15db1d521e97e9b08e889c93 (diff) | |
update enumeration up to get full configuration descriptor
Diffstat (limited to 'tinyusb/common')
| -rw-r--r-- | tinyusb/common/common.h | 14 | ||||
| -rw-r--r-- | tinyusb/common/errors.h | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h index a3c8cfef5..6859b0e01 100644 --- a/tinyusb/common/common.h +++ b/tinyusb/common/common.h @@ -109,15 +109,21 @@ static inline uint32_t u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b } /// min value -static inline uint32_t min_of(uint32_t x, uint32_t y) ATTR_ALWAYS_INLINE ATTR_CONST; -static inline uint32_t min_of(uint32_t x, uint32_t y) +static inline uint8_t min8_of(uint8_t x, uint8_t y) ATTR_ALWAYS_INLINE ATTR_CONST; +static inline uint8_t min8_of(uint8_t x, uint8_t y) +{ + return (x < y) ? x : y; +} + +static inline uint32_t min32_of(uint32_t x, uint32_t y) ATTR_ALWAYS_INLINE ATTR_CONST; +static inline uint32_t min32_of(uint32_t x, uint32_t y) { return (x < y) ? x : y; } /// max value -static inline uint32_t max_of(uint32_t x, uint32_t y) ATTR_ALWAYS_INLINE ATTR_CONST; -static inline uint32_t max_of(uint32_t x, uint32_t y) +static inline uint32_t max32_of(uint32_t x, uint32_t y) ATTR_ALWAYS_INLINE ATTR_CONST; +static inline uint32_t max32_of(uint32_t x, uint32_t y) { return (x > y) ? x : y; } diff --git a/tinyusb/common/errors.h b/tinyusb/common/errors.h index 57de5cea4..42855ffed 100644 --- a/tinyusb/common/errors.h +++ b/tinyusb/common/errors.h @@ -67,6 +67,7 @@ ENTRY(TUSB_ERROR_CLASS_DATA_NOT_AVAILABLE)\ ENTRY(TUSB_ERROR_HCD_FAILED)\ ENTRY(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND)\ + ENTRY(TUSB_ERROR_USBH_MOUNT_CONFIG_DESC_TOO_LONG)\ ENTRY(TUSB_ERROR_OSAL_TIMEOUT)\ ENTRY(TUSB_ERROR_OSAL_TASK_FAILED)\ ENTRY(TUSB_ERROR_OSAL_QUEUE_FAILED)\ |
