rename edpt_dir/number/addr to tu_edpt_*
This commit is contained in:
		@@ -132,8 +132,8 @@ bool dcd_edpt_open (uint8_t rhport, tusb_desc_endpoint_t const * desc_edpt)
 | 
			
		||||
{
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(desc_edpt->bEndpointAddress);
 | 
			
		||||
  uint8_t const dir   = edpt_dir(desc_edpt->bEndpointAddress);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(desc_edpt->bEndpointAddress);
 | 
			
		||||
  uint8_t const dir   = tu_edpt_dir(desc_edpt->bEndpointAddress);
 | 
			
		||||
 | 
			
		||||
  UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
 | 
			
		||||
  uint32_t size_value = 0;
 | 
			
		||||
@@ -168,8 +168,8 @@ bool dcd_edpt_xfer (uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t
 | 
			
		||||
{
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const dir   = edpt_dir(ep_addr);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const dir   = tu_edpt_dir(ep_addr);
 | 
			
		||||
 | 
			
		||||
  UsbDeviceDescBank* bank = &sram_registers[epnum][dir];
 | 
			
		||||
  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
 | 
			
		||||
@@ -208,19 +208,19 @@ bool dcd_edpt_stalled (uint8_t rhport, uint8_t ep_addr)
 | 
			
		||||
      return false;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(ep_addr);
 | 
			
		||||
  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
 | 
			
		||||
  return (edpt_dir(ep_addr) == TUSB_DIR_IN ) ? ep->EPINTFLAG.bit.STALL1 : ep->EPINTFLAG.bit.STALL0;
 | 
			
		||||
  return (tu_edpt_dir(ep_addr) == TUSB_DIR_IN ) ? ep->EPINTFLAG.bit.STALL1 : ep->EPINTFLAG.bit.STALL0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr)
 | 
			
		||||
{
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(ep_addr);
 | 
			
		||||
  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
 | 
			
		||||
 | 
			
		||||
  if (edpt_dir(ep_addr) == TUSB_DIR_IN) {
 | 
			
		||||
  if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
 | 
			
		||||
      ep->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1;
 | 
			
		||||
  } else {
 | 
			
		||||
      ep->EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0;
 | 
			
		||||
@@ -236,10 +236,10 @@ void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr)
 | 
			
		||||
{
 | 
			
		||||
  (void) rhport;
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(ep_addr);
 | 
			
		||||
  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
 | 
			
		||||
 | 
			
		||||
  if (edpt_dir(ep_addr) == TUSB_DIR_IN) {
 | 
			
		||||
  if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
 | 
			
		||||
    ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1;
 | 
			
		||||
  } else {
 | 
			
		||||
    ep->EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0;
 | 
			
		||||
@@ -253,10 +253,10 @@ bool dcd_edpt_busy (uint8_t rhport, uint8_t ep_addr)
 | 
			
		||||
  // USBD shouldn't check control endpoint state
 | 
			
		||||
  if ( 0 == ep_addr ) return false;
 | 
			
		||||
 | 
			
		||||
  uint8_t const epnum = edpt_number(ep_addr);
 | 
			
		||||
  uint8_t const epnum = tu_edpt_number(ep_addr);
 | 
			
		||||
  UsbDeviceEndpoint* ep = &USB->DEVICE.DeviceEndpoint[epnum];
 | 
			
		||||
 | 
			
		||||
  if (edpt_dir(ep_addr) == TUSB_DIR_IN) {
 | 
			
		||||
  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;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user