summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2023-07-24 22:08:53 +0700
committerGitHub <[email protected]>2023-07-24 22:08:53 +0700
commit9554283b03cb4af00119ccd5a38e539749b32d53 (patch)
tree93c878d68b05feae51aa672f5021005297997e30 /src/common
parent0b38941362b6ff2fe3fb7aba1507e82798cd9c16 (diff)
parentfda92fd34a8fe0d08e5c51fab4ea38f6849051e8 (diff)
Merge pull request #2175 from hathach/hcd-abort-xfer
Add HCD abort xfer API
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index bae583c06..eb4c3ce81 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -53,6 +53,8 @@
#define U32_TO_U8S_LE(_u32) TU_U32_BYTE0(_u32), TU_U32_BYTE1(_u32), TU_U32_BYTE2(_u32), TU_U32_BYTE3(_u32)
#define TU_BIT(n) (1UL << (n))
+
+// Generate a mask with bit from high (31) to low (0) set, e.g TU_GENMASK(3, 0) = 0b1111
#define TU_GENMASK(h, l) ( (UINT32_MAX << (l)) & (UINT32_MAX >> (31 - (h))) )
//--------------------------------------------------------------------+