implement tuh_edpt_xfer() for non-control

This commit is contained in:
hathach
2022-03-18 22:22:21 +07:00
parent 9ae0304b1e
commit ba1185bf28
5 changed files with 201 additions and 126 deletions

View File

@@ -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)