Przeglądaj źródła

remove dcd_edpt_busy()

hathach 7 lat temu
rodzic
commit
73d7ab201e

+ 0 - 3
src/device/dcd.h

@@ -110,9 +110,6 @@ bool dcd_edpt_open        (uint8_t rhport, tusb_desc_endpoint_t const * p_endpoi
 // Submit a transfer, When complete dcd_event_xfer_complete() is invoked to notify the stack
 bool dcd_edpt_xfer        (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes);
 
-// Check if endpoint transferring is complete (TODO remove)
-bool dcd_edpt_busy        (uint8_t rhport, uint8_t ep_addr);
-
 // Stall endpoint
 void dcd_edpt_stall       (uint8_t rhport, uint8_t ep_addr);
 

+ 0 - 16
src/portable/microchip/samd21/dcd_samd21.c

@@ -229,22 +229,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;
-
-  // USBD shouldn't check control endpoint state
-  if ( 0 == ep_addr ) return false;
-
-  uint8_t const epnum = tu_edpt_number(ep_addr);
-  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
-  if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
-    return ep->EPINTFLAG.bit.TRCPT1 == 0 && ep->EPSTATUS.bit.BK1RDY == 1;
-  }
-  return ep->EPINTFLAG.bit.TRCPT0 == 0 && ep->EPSTATUS.bit.BK0RDY == 1;
-}
-
 /*------------------------------------------------------------------*/
 
 static bool maybe_handle_setup_packet(void) {

+ 0 - 16
src/portable/microchip/samd51/dcd_samd51.c

@@ -233,22 +233,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;
-
-  // USBD shouldn't check control endpoint state
-  if ( 0 == ep_addr ) return false;
-
-  uint8_t const epnum = tu_edpt_number(ep_addr);
-  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
-
-  if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
-    return ep->EPINTFLAG.bit.TRCPT1 == 0 && ep->EPSTATUS.bit.BK1RDY == 1;
-  }
-  return ep->EPINTFLAG.bit.TRCPT0 == 0 && ep->EPSTATUS.bit.BK0RDY == 1;
-}
-
 /*------------------------------------------------------------------*/
 
 static bool maybe_handle_setup_packet(void) {

+ 0 - 15
src/portable/nordic/nrf5x/dcd_nrf5x.c

@@ -332,21 +332,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;
-
-  // USBD shouldn't check control endpoint state
-  if ( 0 == tu_edpt_number(ep_addr) ) return false;
-
-  uint8_t const epnum = tu_edpt_number(ep_addr);
-  uint8_t const dir   = tu_edpt_dir(ep_addr);
-
-  xfer_td_t* xfer = get_td(epnum, dir);
-
-  return xfer->actual_len < xfer->total_len;
-}
-
 /*------------------------------------------------------------------*/
 /* Interrupt Handler
  *------------------------------------------------------------------*/

+ 0 - 8
src/portable/nxp/lpc11_13_15/dcd_lpc11_13_15.c

@@ -218,14 +218,6 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
   return true;
 }
 
-bool dcd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
-{
-  (void) rhport;
-
-  uint8_t const ep_id = ep_addr2id(ep_addr);
-  return _dcd.ep[ep_id][0].active;
-}
-
 static void prepare_ep_xfer(uint8_t ep_id, uint16_t buf_offset, uint16_t total_bytes)
 {
   uint16_t const nbytes = tu_min16(total_bytes, DMA_NBYTES_MAX);

+ 0 - 8
src/portable/nxp/lpc17_40/dcd_lpc17_40.c

@@ -316,14 +316,6 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
   return true;
 }
 
-bool dcd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
-{
-  (void) rhport;
-
-  uint8_t ep_id = ep_addr2idx( ep_addr );
-  return (_dcd.udca[ep_id] != NULL && !_dcd.udca[ep_id]->retired);
-}
-
 void dcd_edpt_stall(uint8_t rhport, uint8_t ep_addr)
 {
   (void) rhport;

+ 0 - 12
src/portable/nxp/lpc18_43/dcd_lpc18_43.c

@@ -240,18 +240,6 @@ bool dcd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc)
   return true;
 }
 
-bool dcd_edpt_busy(uint8_t rhport, uint8_t ep_addr)
-{
-  uint8_t const epnum  = tu_edpt_number(ep_addr);
-  uint8_t const dir    = tu_edpt_dir(ep_addr);
-  uint8_t const ep_idx = 2*epnum + dir;
-
-  dcd_qtd_t * p_qtd = &dcd_data_ptr[rhport]->qtd[ep_idx];
-
-  return p_qtd->active;
-//  return !p_qhd->qtd_overlay.halted && p_qhd->qtd_overlay.active;
-}
-
 bool dcd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
 {
   uint8_t const epnum = tu_edpt_number(ep_addr);

+ 9 - 5
src/portable/st/stm32f3/dcd_stm32f3.c

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

+ 0 - 26
src/portable/st/stm32f4/dcd_stm32f4.c

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