summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2026-03-09 11:59:20 +0700
committerGitHub <[email protected]>2026-03-09 11:59:20 +0700
commit7fac2cda29a14e963c469a146f18ea294f955171 (patch)
tree90dbaedbfd233c0b730e0cb44928d42bb36a8ffb /src
parent205d9b044fdb96cea001603368c43c1f34fa1cf5 (diff)
parent11a3c3b712eb97e5c05ed3df20dcde9451fe158d (diff)
Merge pull request #3536
Fix ep_ctrl_mask() corrupting opposite direction's ENDPTCTRL bits
Diffstat (limited to 'src')
-rw-r--r--src/portable/chipidea/ci_hs/dcd_ci_hs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/portable/chipidea/ci_hs/dcd_ci_hs.c b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
index b9f6a8a7b..9ed75ffd9 100644
--- a/src/portable/chipidea/ci_hs/dcd_ci_hs.c
+++ b/src/portable/chipidea/ci_hs/dcd_ci_hs.c
@@ -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);