summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorhathach <[email protected]>2021-10-29 16:08:19 +0700
committerhathach <[email protected]>2021-10-29 16:08:19 +0700
commit660e8b8c887091e17323c361f25e804a5d06d6df (patch)
treec178885c30065c9ef8985fe9d714408bad531fa9 /src/common
parent6c67fc412516950622a13fb34ddc10b64b9b3843 (diff)
skip snpsid check for gd32, abstract phyfs turnaround, set max timeout calibration.
still has issue with gd32 with msc (does work with running with rtt as log).
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index e62bcde12..9b9e2b007 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -111,6 +111,9 @@ TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte2(uint32_t ui32) { return
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte1(uint32_t ui32) { return TU_U32_BYTE1(ui32); }
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u32_byte0(uint32_t ui32) { return TU_U32_BYTE0(ui32); }
+TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_u32_high16(uint32_t ui32) { return (uint16_t) (ui32 >> 16); }
+TU_ATTR_ALWAYS_INLINE static inline uint16_t tu_u32_low16 (uint32_t ui32) { return (uint16_t) (ui32 & 0x0000ffffu); }
+
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u16_high(uint16_t ui16) { return TU_U16_HIGH(ui16); }
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_u16_low (uint16_t ui16) { return TU_U16_LOW(ui16); }