diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/host/ehci/ehci.c | 4 | ||||
| -rw-r--r-- | src/host/hcd.h | 3 | ||||
| -rw-r--r-- | src/host/ohci/ohci.c | 2 | ||||
| -rw-r--r-- | src/host/usbh.c | 2 | ||||
| -rw-r--r-- | src/host/usbh_hcd.h | 3 |
5 files changed, 8 insertions, 6 deletions
diff --git a/src/host/ehci/ehci.c b/src/host/ehci/ehci.c index 445210c8b..f21e4cee2 100644 --- a/src/host/ehci/ehci.c +++ b/src/host/ehci/ehci.c @@ -647,7 +647,7 @@ static void qhd_xfer_complete_isr(ehci_qhd_t * p_qhd) {
// end of request
// call USBH callback
- usbh_xfer_isr(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), XFER_RESULT_SUCCESS, p_qhd->total_xferred_bytes);
+ hcd_event_xfer_complete(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), XFER_RESULT_SUCCESS, p_qhd->total_xferred_bytes);
p_qhd->total_xferred_bytes = 0;
}
@@ -741,7 +741,7 @@ static void qhd_xfer_error_isr(ehci_qhd_t * p_qhd) }
// call USBH callback
- usbh_xfer_isr(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), error_event, p_qhd->total_xferred_bytes);
+ hcd_event_xfer_complete(p_qhd->device_address, edpt_addr(p_qhd->endpoint_number, p_qhd->pid_non_control == EHCI_PID_IN ? 1 : 0), error_event, p_qhd->total_xferred_bytes);
p_qhd->total_xferred_bytes = 0;
}
diff --git a/src/host/hcd.h b/src/host/hcd.h index 14ec68a48..31a1876b4 100644 --- a/src/host/hcd.h +++ b/src/host/hcd.h @@ -127,6 +127,9 @@ void hcd_event_device_attach(uint8_t rhport); // Helper to send device removal event
void hcd_event_device_remove(uint8_t hostid);
+// Helper to send USB transfer event
+void hcd_event_xfer_complete(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes);
+
//--------------------------------------------------------------------+
// Endpoints API
//--------------------------------------------------------------------+
diff --git a/src/host/ohci/ohci.c b/src/host/ohci/ohci.c index 88296fb82..08d562e0d 100644 --- a/src/host/ohci/ohci.c +++ b/src/host/ohci/ohci.c @@ -717,7 +717,7 @@ static void done_queue_isr(uint8_t hostid) if ( pipe_hdl.xfer_type != TUSB_XFER_CONTROL) pipe_hdl.index = ed_get_index(p_ed);
- usbh_xfer_isr(pipe_hdl, p_ed->td_tail.class_code, event, xferred_bytes);
+ hcd_event_xfer_complete(pipe_hdl, p_ed->td_tail.class_code, event, xferred_bytes);
}
td_head = (ohci_td_item_t*) td_head->next_td;
diff --git a/src/host/usbh.c b/src/host/usbh.c index a9e825f70..ff9ca9666 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -256,7 +256,7 @@ static inline tusb_error_t usbh_pipe_control_close(uint8_t dev_addr) // USBH-HCD ISR/Callback API
//--------------------------------------------------------------------+
// interrupt caused by a TD (with IOC=1) in pipe of class class_code
-void usbh_xfer_isr(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
+void hcd_event_xfer_complete(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes)
{
usbh_device_t* dev = &_usbh_devices[ dev_addr ];
diff --git a/src/host/usbh_hcd.h b/src/host/usbh_hcd.h index 3c1c1511d..48bb4bb9d 100644 --- a/src/host/usbh_hcd.h +++ b/src/host/usbh_hcd.h @@ -72,7 +72,6 @@ typedef struct { //------------- device -------------// volatile uint8_t state; // device state, value from enum tusbh_device_state_t - uint32_t flag_supported_class; // a bitmap of supported class //------------- control pipe -------------// struct { @@ -96,7 +95,7 @@ extern usbh_device_t _usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; // including zer //--------------------------------------------------------------------+ // callback from HCD ISR //--------------------------------------------------------------------+ -void usbh_xfer_isr(uint8_t dev_addr, uint8_t ep_addr, xfer_result_t event, uint32_t xferred_bytes); + #ifdef __cplusplus |
