From ba1185bf28331da718cca38e6598361889fce54d Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 18 Mar 2022 22:22:21 +0700 Subject: implement tuh_edpt_xfer() for non-control --- src/class/hid/hid_host.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/class') diff --git a/src/class/hid/hid_host.c b/src/class/hid/hid_host.c index fa99b37fe..2bdd1db79 100644 --- a/src/class/hid/hid_host.c +++ b/src/class/hid/hid_host.c @@ -256,7 +256,13 @@ bool tuh_hid_receive_report(uint8_t dev_addr, uint8_t instance) // claim endpoint TU_VERIFY( usbh_edpt_claim(dev_addr, hid_itf->ep_in) ); - return usbh_edpt_xfer(dev_addr, hid_itf->ep_in, hid_itf->epin_buf, hid_itf->epin_size); + if ( !usbh_edpt_xfer(dev_addr, hid_itf->ep_in, hid_itf->epin_buf, hid_itf->epin_size) ) + { + usbh_edpt_claim(dev_addr, hid_itf->ep_in); + return false; + } + + return true; } //bool tuh_n_hid_n_ready(uint8_t dev_addr, uint8_t instance) -- cgit v1.3.1