diff options
| author | hathach <[email protected]> | 2013-09-26 00:17:45 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-09-26 00:17:45 +0700 |
| commit | 09724c5d11e14b162ccc1ab2dde4b64987b05817 (patch) | |
| tree | 16a957da2e469496908eb83529335f8dcc3b0029 /tinyusb/common | |
| parent | b995e25308cb51b9353e7d86faaf44e36c552b67 (diff) | |
refractor msch
Diffstat (limited to 'tinyusb/common')
| -rw-r--r-- | tinyusb/common/common.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tinyusb/common/common.h b/tinyusb/common/common.h index 3a43f123c..73de8bce6 100644 --- a/tinyusb/common/common.h +++ b/tinyusb/common/common.h @@ -134,6 +134,12 @@ static inline uint8_t u16_low_u8(uint16_t u16) return (uint8_t) (u16 & 0x00ff); } +static inline uint16_t u16_le2be(uint16_t u16) ATTR_CONST ATTR_ALWAYS_INLINE; +static inline uint16_t u16_le2be(uint16_t u16) +{ + return (u16_low_u8(u16) << 8) | u16_high_u8(u16); +} + //------------- Min -------------// 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) |
