summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2024-04-04 10:55:14 +0700
committerhathach <[email protected]>2024-04-04 10:55:14 +0700
commit7910cc298187327e05c43770b58eac528a4fecfa (patch)
tree5d35b0c45bd126d4ca71e730b7e4d28bd590eb51 /src
parent66cdf6d097d76f8d21ed4314651ac730d4023f99 (diff)
fix build with rp2040 + max3421
- forward MAX3421_HOST=1 from makefile to cmake - add feather_rp2040_max3421 board to run with ci for rp2040 + max3421
Diffstat (limited to 'src')
-rw-r--r--src/portable/analog/max3421/hcd_max3421.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/portable/analog/max3421/hcd_max3421.c b/src/portable/analog/max3421/hcd_max3421.c
index 242c65501..76c1a150b 100644
--- a/src/portable/analog/max3421/hcd_max3421.c
+++ b/src/portable/analog/max3421/hcd_max3421.c
@@ -676,19 +676,18 @@ bool hcd_edpt_xfer(uint8_t rhport, uint8_t daddr, uint8_t ep_addr, uint8_t * buf
max3421_ep_t* ep = find_opened_ep(daddr, ep_num, ep_dir);
TU_VERIFY(ep);
- // control transfer can switch direction
- ep->hxfr_bm.is_out = ep_dir ? 0u : 1u;
+ if (ep_num == 0) {
+ // control transfer can switch direction
+ ep->hxfr_bm.is_out = ep_dir ? 0 : 1;
+ ep->hxfr_bm.is_setup = 0;
+ ep->data_toggle = 1;
+ }
ep->buf = buffer;
ep->total_len = buflen;
ep->xferred_len = 0;
ep->state = EP_STATE_ATTEMPT_1;
- if (ep_num == 0) {
- ep->hxfr_bm.is_setup = 0;
- ep->data_toggle = 1;
- }
-
// carry out transfer if not busy
if (!atomic_flag_test_and_set(&_hcd_data.busy)) {
xact_generic(rhport, ep, true, false);