We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a3a5a41 + dc196b2 commit fc5415bCopy full SHA for fc5415b
src/common/tusb_types.h
@@ -103,6 +103,7 @@ typedef enum {
103
TUSB_DIR_OUT = 0,
104
TUSB_DIR_IN = 1,
105
106
+ TUSB_EPNUM_MASK = 0x0F,
107
TUSB_DIR_IN_MASK = 0x80
108
} tusb_dir_t;
109
@@ -544,7 +545,7 @@ TU_ATTR_ALWAYS_INLINE static inline tusb_dir_t tu_edpt_dir(uint8_t addr) {
544
545
546
// Get Endpoint number from address
547
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_edpt_number(uint8_t addr) {
- return (uint8_t) (addr & (~TUSB_DIR_IN_MASK));
548
+ return (uint8_t) (addr & TUSB_EPNUM_MASK);
549
}
550
551
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_edpt_addr(uint8_t num, uint8_t dir) {
0 commit comments