summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-07-01 20:28:16 +0700
committerhathach <[email protected]>2013-07-01 20:28:16 +0700
commit958d390a852160f040508775202e827766fc0498 (patch)
tree8d757111d2a7c0e9dba26815f350478fb965c021 /tinyusb
parent3f9f3f08d2429ee51e1545464686f671253ac98f (diff)
refractor code
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/host/ehci/ehci.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index f30c9844f..5ef8d0250 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -614,17 +614,10 @@ 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,
- .xfer_type = TUSB_XFER_CONTROL
- };
+ tusb_xfer_type_t xfer_type = p_qhd->endpoint_number != 0 ? TUSB_XFER_BULK : 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_xfer_isr( pipe_hdl, p_qhd->class_code, TUSB_EVENT_XFER_ERROR); // call USBH callback
+ usbh_xfer_isr( qhd_create_pipe_handle(p_qhd, xfer_type),
+ p_qhd->class_code, TUSB_EVENT_XFER_ERROR); // call USBH callback
}
p_qhd = qhd_next(p_qhd);