rename usbh_isr to usbh_xfer_isr

This commit is contained in:
hathach
2013-07-01 15:30:29 +07:00
parent 35adca5ba3
commit 3f0d740776
8 changed files with 28 additions and 12 deletions

View File

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

View File

@@ -128,6 +128,8 @@ typedef struct {
struct {
uint32_t : 5;
uint32_t used : 1;
uint32_t : 10;
uint32_t expected_bytes : 16;
};
};

View File

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

View File

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