remove dcd_edpt_busy()

This commit is contained in:
hathach
2019-06-10 22:29:18 +07:00
parent 7156bfb54d
commit 73d7ab201e
9 changed files with 9 additions and 109 deletions
+9 -5
View File
@@ -67,15 +67,19 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc
{
return false;
}
bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
{ return false;}
bool dcd_edpt_busy (uint8_t rhport, uint8_t ep_addr)
{ return false;}
{
return false;
}
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
{}
{
}
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
{}
{
}
#endif
-26
View File
@@ -397,32 +397,6 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
}
}
bool dcd_edpt_busy (uint8_t rhport, uint8_t ep_addr)
{
(void) rhport;
USB_OTG_OUTEndpointTypeDef * out_ep = OUT_EP_BASE;
USB_OTG_INEndpointTypeDef * in_ep = IN_EP_BASE;
// USBD shouldn't check control endpoint state
if ( 0 == ep_addr ) return false;
uint8_t const epnum = tu_edpt_number(ep_addr);
bool enabled = false;
bool xferring = true;
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
enabled = (in_ep[epnum].DIEPCTL & USB_OTG_DIEPCTL_EPENA_Msk);
xferring = (in_ep[epnum].DIEPTSIZ & USB_OTG_DIEPTSIZ_PKTCNT_Msk);
} else {
enabled = (out_ep[epnum].DOEPCTL & USB_OTG_DOEPCTL_EPENA_Msk);
xferring = (out_ep[epnum].DOEPTSIZ & USB_OTG_DOEPTSIZ_PKTCNT_Msk);
}
// TODO: Also check that endpoint is active (not just enabled)?
return (enabled && xferring);
}
/*------------------------------------------------------------------*/
// TODO: Split into "receive on endpoint 0" and "receive generic"; endpoint 0's