diff options
| author | hathach <[email protected]> | 2019-05-12 15:54:11 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-12 15:54:11 +0700 |
| commit | aaf5848ce15c5d6ccf4c51c3ef7b04fb787639ee (patch) | |
| tree | 2a04ff594ea42234c532fc4ab5f8e6f0b4603623 /src/common/tusb_common.h | |
| parent | bfa073818c83266c2353ccf4fce580eef62e4a0c (diff) | |
| parent | 1174949308bb7595e99fd5789ebf3466cf2ab123 (diff) | |
Merge pull request #64 from hathach/develop
add callback for descriptors device/configuration/string/hid
Diffstat (limited to 'src/common/tusb_common.h')
| -rw-r--r-- | src/common/tusb_common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index 0b5a37922..e687b8983 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -142,6 +142,11 @@ static inline uint32_t tu_u32_from_u8(uint8_t b1, uint8_t b2, uint8_t b3, uint8_ return ( ((uint32_t) b1) << 24) + ( ((uint32_t) b2) << 16) + ( ((uint32_t) b3) << 8) + b4;
}
+static inline uint16_t tu_u16_from_u8(uint8_t high, uint8_t low)
+{
+ return (((uint16_t) high) << 8) + low;
+}
+
static inline uint8_t tu_u16_high(uint16_t u16)
{
return (uint8_t) ( ((uint16_t) (u16 >> 8)) & 0x00ff);
|
