mirror of
https://github.com/hathach/tinyusb.git
synced 2026-03-16 20:45:03 +00:00
Fix ep_ctrl_mask() corrupting opposite direction's ENDPTCTRL bits
This commit is contained in:
@ -388,7 +388,7 @@ TU_ATTR_ALWAYS_INLINE static inline void ep_ctrl_mask(volatile uint32_t *epctrl,
|
||||
uint32_t or_mask) {
|
||||
uint32_t value = *epctrl;
|
||||
if (and_mask != 0) {
|
||||
value &= (dir == TUSB_DIR_OUT) ? and_mask : (and_mask << 16u);
|
||||
value &= (dir == TUSB_DIR_OUT) ? (and_mask | 0xFFFF0000u) : ((and_mask << 16u) | 0x0000FFFFu);
|
||||
}
|
||||
if (or_mask != 0) {
|
||||
value |= (dir == TUSB_DIR_OUT) ? or_mask : (or_mask << 16u);
|
||||
|
||||
Reference in New Issue
Block a user