Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/tusb_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ typedef enum {
TUSB_DIR_OUT = 0,
TUSB_DIR_IN = 1,

TUSB_EPNUM_MASK = 0x0F,
TUSB_DIR_IN_MASK = 0x80
} tusb_dir_t;

Expand Down Expand Up @@ -544,7 +545,7 @@ TU_ATTR_ALWAYS_INLINE static inline tusb_dir_t tu_edpt_dir(uint8_t addr) {

// Get Endpoint number from address
TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_edpt_number(uint8_t addr) {
return (uint8_t) (addr & (~TUSB_DIR_IN_MASK));
return (uint8_t) (addr & TUSB_EPNUM_MASK);
}

TU_ATTR_ALWAYS_INLINE static inline uint8_t tu_edpt_addr(uint8_t num, uint8_t dir) {
Expand Down
Loading