mirror of
https://github.com/hathach/tinyusb.git
synced 2025-02-21 21:41:09 +00:00
fixed EP0 control handling
This commit is contained in:
parent
998090d1a7
commit
818c64efec
@ -828,36 +828,36 @@ static void handle_xfer_done(uint8_t rhport, bool in_isr) {
|
|||||||
// putchar('0' + ep->ep_num);
|
// putchar('0' + ep->ep_num);
|
||||||
// putchar('0' + ep->xfer_attemp);
|
// putchar('0' + ep->xfer_attemp);
|
||||||
#endif
|
#endif
|
||||||
#if NAK_RETRY_HANDLING
|
|
||||||
ep->retry_pending = 1;
|
|
||||||
ep->xfer_pending = 0;
|
|
||||||
max3421_ep_t * next_ep = find_next_pending_ep(ep);
|
|
||||||
if (next_ep) {
|
|
||||||
// switch to next pending TODO could have issue with double buffered if not clear previously out data
|
|
||||||
xact_inout(rhport, next_ep, true, in_isr);
|
|
||||||
} else {
|
|
||||||
// no more pending
|
|
||||||
atomic_flag_clear(&_hcd_data.busy);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
if (ep_num == 0) {
|
if (ep_num == 0) {
|
||||||
// NAK on control, retry immediately
|
// NAK on control, retry immediately
|
||||||
hxfr_write(rhport, _hcd_data.hxfr, in_isr);
|
hxfr_write(rhport, _hcd_data.hxfr, in_isr);
|
||||||
}else {
|
} else {
|
||||||
|
#if NAK_RETRY_HANDLING
|
||||||
|
ep->retry_pending = 1;
|
||||||
|
ep->xfer_pending = 0;
|
||||||
|
max3421_ep_t * next_ep = find_next_pending_ep(ep);
|
||||||
|
if (next_ep) {
|
||||||
|
// switch to next pending TODO could have issue with double buffered if not clear previously out data
|
||||||
|
xact_inout(rhport, next_ep, true, in_isr);
|
||||||
|
} else {
|
||||||
|
// no more pending
|
||||||
|
atomic_flag_clear(&_hcd_data.busy);
|
||||||
|
}
|
||||||
|
#else
|
||||||
// NAK on non-control, find next pending to switch
|
// NAK on non-control, find next pending to switch
|
||||||
max3421_ep_t *next_ep = find_next_pending_ep(ep);
|
max3421_ep_t *next_ep = find_next_pending_ep(ep);
|
||||||
|
|
||||||
if (ep == next_ep) {
|
if (ep == next_ep) {
|
||||||
// this endpoint is only one pending, retry immediately
|
// this endpoint is only one pending, retry immediately
|
||||||
hxfr_write(rhport, _hcd_data.hxfr, in_isr);
|
hxfr_write(rhport, _hcd_data.hxfr, in_isr);
|
||||||
}else if (next_ep) {
|
} else if (next_ep) {
|
||||||
// switch to next pending TODO could have issue with double buffered if not clear previously out data
|
// switch to next pending TODO could have issue with double buffered if not clear previously out data
|
||||||
xact_inout(rhport, next_ep, true, in_isr);
|
xact_inout(rhport, next_ep, true, in_isr);
|
||||||
}else {
|
} else {
|
||||||
TU_ASSERT(false,);
|
TU_ASSERT(false,);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case HRSL_BAD_REQ:
|
case HRSL_BAD_REQ:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user