rename usbh_isr to usbh_xfer_isr
This commit is contained in:
		@@ -208,7 +208,7 @@ void test_bulk_xfer_complete_isr(void)
 | 
			
		||||
  ehci_qtd_t* p_head = p_qhd_bulk->p_qtd_list_head;
 | 
			
		||||
  ehci_qtd_t* p_tail = p_qhd_bulk->p_qtd_list_tail;
 | 
			
		||||
 | 
			
		||||
  usbh_isr_Expect(pipe_hdl_bulk, TUSB_CLASS_MSC, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
  usbh_xfer_isr_Expect(pipe_hdl_bulk, TUSB_CLASS_MSC, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
 | 
			
		||||
  //------------- Code Under Test -------------//
 | 
			
		||||
  ehci_controller_run(hostid);
 | 
			
		||||
 
 | 
			
		||||
@@ -227,7 +227,7 @@ void test_control_xfer_complete_isr(void)
 | 
			
		||||
{
 | 
			
		||||
  TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) );
 | 
			
		||||
 | 
			
		||||
  usbh_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
  usbh_xfer_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
 | 
			
		||||
  //------------- Code Under TEST -------------//
 | 
			
		||||
  ehci_controller_run(hostid);
 | 
			
		||||
@@ -245,7 +245,7 @@ void test_control_xfer_error_isr(void)
 | 
			
		||||
{
 | 
			
		||||
  TEST_ASSERT_STATUS( hcd_pipe_control_xfer(dev_addr, &request_get_dev_desc, xfer_data) );
 | 
			
		||||
 | 
			
		||||
  usbh_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_ERROR);
 | 
			
		||||
  usbh_xfer_isr_Expect(((pipe_handle_t){.dev_addr = dev_addr}), 0, TUSB_EVENT_XFER_ERROR);
 | 
			
		||||
 | 
			
		||||
  //------------- Code Under TEST -------------//
 | 
			
		||||
  ehci_controller_run_error(hostid);
 | 
			
		||||
 
 | 
			
		||||
@@ -200,7 +200,7 @@ void test_interrupt_xfer_complete_isr_interval_less_than_1ms(void)
 | 
			
		||||
 | 
			
		||||
  TEST_ASSERT_STATUS( hcd_pipe_xfer(pipe_hdl_interrupt, data2, sizeof(data2), true) );
 | 
			
		||||
 | 
			
		||||
  usbh_isr_Expect(pipe_hdl_interrupt, TUSB_CLASS_HID, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
  usbh_xfer_isr_Expect(pipe_hdl_interrupt, TUSB_CLASS_HID, TUSB_EVENT_XFER_COMPLETE);
 | 
			
		||||
 | 
			
		||||
  ehci_qtd_t* p_head = p_qhd_interrupt->p_qtd_list_head;
 | 
			
		||||
  ehci_qtd_t* p_tail = p_qhd_interrupt->p_qtd_list_tail;
 | 
			
		||||
 
 | 
			
		||||
@@ -57,6 +57,11 @@
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// APPLICATION PUBLIC API
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
bool tusbh_cdc_acm_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
 | 
			
		||||
bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
 | 
			
		||||
bool tusbh_cdc_rndis_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
 | 
			
		||||
 | 
			
		||||
tusb_interface_status_t tusbh_cdc_send(void const * p_data, uint32_t length);
 | 
			
		||||
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// USBH-CLASS API
 | 
			
		||||
 
 | 
			
		||||
@@ -519,19 +519,24 @@ void async_list_process_isr(ehci_qhd_t * const async_head)
 | 
			
		||||
      {
 | 
			
		||||
        // TD need to be freed and removed from qhd, before invoking callback
 | 
			
		||||
        bool is_ioc = (p_qhd->p_qtd_list_head->int_on_complete != 0);
 | 
			
		||||
        uint16_t actual_bytes_xferred = p_qhd->p_qtd_list_head->expected_bytes - p_qhd->p_qtd_list_head->total_bytes;
 | 
			
		||||
 | 
			
		||||
        p_qhd->p_qtd_list_head->used = 0; // free QTD
 | 
			
		||||
        qtd_remove_1st_from_qhd(p_qhd);
 | 
			
		||||
 | 
			
		||||
        if (is_ioc) // end of request
 | 
			
		||||
        {
 | 
			
		||||
          pipe_handle_t pipe_hdl = { .dev_addr = p_qhd->device_address };
 | 
			
		||||
          pipe_handle_t pipe_hdl = {
 | 
			
		||||
              .dev_addr  = p_qhd->device_address,
 | 
			
		||||
              .xfer_type = TUSB_XFER_CONTROL
 | 
			
		||||
          };
 | 
			
		||||
 | 
			
		||||
          if (p_qhd->endpoint_number) // if not Control, can only be Bulk
 | 
			
		||||
          {
 | 
			
		||||
            pipe_hdl.xfer_type = TUSB_XFER_BULK;
 | 
			
		||||
            pipe_hdl.index = qhd_get_index(p_qhd);
 | 
			
		||||
          }
 | 
			
		||||
          usbh_isr( pipe_hdl, p_qhd->class_code, TUSB_EVENT_XFER_COMPLETE); // call USBH callback
 | 
			
		||||
          usbh_xfer_isr( pipe_hdl, p_qhd->class_code, TUSB_EVENT_XFER_COMPLETE); // call USBH callback
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
@@ -572,7 +577,7 @@ void period_list_process_isr(uint8_t hostid, uint8_t interval_ms)
 | 
			
		||||
 | 
			
		||||
            if (is_ioc) // end of request
 | 
			
		||||
            {
 | 
			
		||||
              usbh_isr( (pipe_handle_t)
 | 
			
		||||
              usbh_xfer_isr( (pipe_handle_t)
 | 
			
		||||
                        {
 | 
			
		||||
                              .dev_addr = p_qhd_int->device_address,
 | 
			
		||||
                              .xfer_type = TUSB_XFER_INTERRUPT,
 | 
			
		||||
@@ -617,13 +622,17 @@ void xfer_error_isr(uint8_t hostid)
 | 
			
		||||
      p_qhd->p_qtd_list_head->used = 0; // free QTD
 | 
			
		||||
      qtd_remove_1st_from_qhd(p_qhd);
 | 
			
		||||
 | 
			
		||||
      pipe_handle_t pipe_hdl = { .dev_addr = p_qhd->device_address };
 | 
			
		||||
      pipe_handle_t pipe_hdl = {
 | 
			
		||||
          .dev_addr  = p_qhd->device_address,
 | 
			
		||||
          .xfer_type = TUSB_XFER_CONTROL
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      if (p_qhd->endpoint_number) // if not Control, can only be Bulk
 | 
			
		||||
      {
 | 
			
		||||
        pipe_hdl.xfer_type = TUSB_XFER_BULK;
 | 
			
		||||
        pipe_hdl.index     = qhd_get_index(p_qhd);
 | 
			
		||||
      }
 | 
			
		||||
      usbh_isr( pipe_hdl, p_qhd->class_code, TUSB_EVENT_XFER_ERROR); // call USBH callback
 | 
			
		||||
      usbh_xfer_isr( pipe_hdl, p_qhd->class_code, TUSB_EVENT_XFER_ERROR); // call USBH callback
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    p_qhd = (ehci_qhd_t*) align32(p_qhd->next.address);
 | 
			
		||||
 
 | 
			
		||||
@@ -128,6 +128,8 @@ typedef struct {
 | 
			
		||||
	  struct {
 | 
			
		||||
	    uint32_t      : 5;
 | 
			
		||||
	    uint32_t used : 1;
 | 
			
		||||
	    uint32_t : 10;
 | 
			
		||||
	    uint32_t expected_bytes : 16;
 | 
			
		||||
	  };
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -236,7 +236,7 @@ tusb_interface_status_t usbh_pipe_status_get(pipe_handle_t pipe_hdl)
 | 
			
		||||
// USBH-HCD ISR/Callback API
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// interrupt caused by a TD (with IOC=1) in pipe of class class_code
 | 
			
		||||
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t event)
 | 
			
		||||
void usbh_xfer_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t event)
 | 
			
		||||
{
 | 
			
		||||
  uint8_t class_index = std_class_code_to_index(class_code);
 | 
			
		||||
  if (class_index == 0) // Control transfer
 | 
			
		||||
 
 | 
			
		||||
@@ -113,7 +113,7 @@ extern usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1]; // including
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
// callback from HCD ISR
 | 
			
		||||
//--------------------------------------------------------------------+
 | 
			
		||||
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t event);
 | 
			
		||||
void usbh_xfer_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t event);
 | 
			
		||||
void usbh_device_plugged_isr(uint8_t hostid);
 | 
			
		||||
void usbh_device_unplugged_isr(uint8_t hostid);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user