From 172c9f70c74c541892006ff2bbfea818f40a235a Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 2 Apr 2024 16:55:49 +0700 Subject: [PATCH] clean up --- src/portable/analog/max3421/hcd_max3421.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/portable/analog/max3421/hcd_max3421.c b/src/portable/analog/max3421/hcd_max3421.c index 12d80e0b5..61a7e2703 100644 --- a/src/portable/analog/max3421/hcd_max3421.c +++ b/src/portable/analog/max3421/hcd_max3421.c @@ -173,8 +173,8 @@ enum { enum { EP_STATE_IDLE = 0, - EP_STATE_COMPLETE, - EP_STATE_ATTEMPT_1, // pending 1st attempt + EP_STATE_COMPLETE = 1, + EP_STATE_ATTEMPT_1 = 2, // pending 1st attempt EP_STATE_ATTEMPT_MAX = 15 }; @@ -465,7 +465,6 @@ bool hcd_init(uint8_t rhport) { tuh_max3421_int_api(rhport, false); TU_LOG2_INT(sizeof(max3421_ep_t)); - TU_LOG2_INT(sizeof(atomic_flag)); TU_LOG2_INT(sizeof(max3421_data_t)); TU_LOG2_INT(offsetof(max3421_data_t, ep)); @@ -873,7 +872,9 @@ static void handle_xfer_done(uint8_t rhport, bool in_isr) { if (ep_dir) { // IN transfer: fifo data is already received in RCVDAV IRQ - if ( hxfr_type & HXFR_HS ) { + + // mark control handshake as complete + if (hxfr_type & HXFR_HS) { ep->state = EP_STATE_COMPLETE; }