summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-08-30 16:21:43 +0700
committerhathach <[email protected]>2023-08-30 16:21:43 +0700
commit41493426b38c8ce44b1f7720b907538bc5402f98 (patch)
treee25d55d1cd9d9c8101969edca0b4012e8d5bc790 /src
parent1ab488eb06ef4cb8ad9c0cff91e6b0caf76f73c4 (diff)
use ep buf to keep setup packet, work well with hid device
Diffstat (limited to 'src')
-rw-r--r--src/portable/analog/max3421/hcd_max3421.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/portable/analog/max3421/hcd_max3421.c b/src/portable/analog/max3421/hcd_max3421.c
index 705bb5bfd..d644390da 100644
--- a/src/portable/analog/max3421/hcd_max3421.c
+++ b/src/portable/analog/max3421/hcd_max3421.c
@@ -633,6 +633,7 @@ TU_ATTR_ALWAYS_INLINE static inline void xact_inout(uint8_t rhport, max3421_ep_t
// setup
if (ep->is_setup) {
peraddr_write(rhport, ep->daddr, in_isr);
+ fifo_write(rhport, SUDFIFO_ADDR, ep->buf, 8, in_isr);
hxfr_write(rhport, HXFR_SETUP, in_isr);
return;
}
@@ -703,12 +704,12 @@ bool hcd_setup_send(uint8_t rhport, uint8_t daddr, uint8_t const setup_packet[8]
TU_ASSERT(ep);
ep->ep_dir = 0;
+ ep->is_setup = 1;
+ ep->buf = (uint8_t*)(uintptr_t) setup_packet;
ep->total_len = 8;
ep->xferred_len = 0;
+ ep->xfer_complete = 0;
ep->xfer_pending = 1;
- ep->is_setup = 1;
-
- fifo_write(rhport, SUDFIFO_ADDR, setup_packet, 8, false);
// carry out transfer if not busy
if ( !atomic_flag_test_and_set(&_hcd_data.busy) ) {