summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2018-03-06 17:38:35 +0700
committerhathach <[email protected]>2018-03-06 17:38:35 +0700
commitfce85875c49a7d18115c4f0c2cf91d7f8e5df9d9 (patch)
tree7a84dcdedfd27e7f7384333250ddf7522801c19e
parent98f12c9833b4867cad46ea80ca2525d26fd6b075 (diff)
remove tusb_isr(), rename hal_hcd_isr() and hal_dcd_isr()
-rw-r--r--hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c2
-rw-r--r--hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c2
-rw-r--r--hw/mcu/nxp/lpc175x_6x/hal_mcu/hal_lpc175x_6x.c8
-rw-r--r--hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c2
-rw-r--r--hw/mcu/nxp/lpc43xx/tusb_port/hal_lpc43xx.c18
-rw-r--r--tinyusb/device/dcd.h3
-rw-r--r--tinyusb/device/dcd_lpc175x_6x.c4
-rw-r--r--tinyusb/device/dcd_lpc_11uxx_13uxx.c2
-rw-r--r--tinyusb/host/ehci/ehci.c2
-rw-r--r--tinyusb/host/hcd.h2
-rw-r--r--tinyusb/host/ohci/ohci.c2
-rw-r--r--tinyusb/tusb.c17
-rw-r--r--tinyusb/tusb.h2
13 files changed, 32 insertions, 34 deletions
diff --git a/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c b/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
index c8f5b490b..42f1f524d 100644
--- a/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
+++ b/hw/mcu/nxp/lpc11uxx/hal_mcu/hal_lpc11uxx.c
@@ -75,7 +75,7 @@ bool hal_usb_init(void)
void USB_IRQHandler(void)
{
- tusb_isr(0);
+ hal_dcd_isr(0);
}
#endif
diff --git a/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c b/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
index 2f13a2f98..72d67aa60 100644
--- a/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
+++ b/hw/mcu/nxp/lpc13uxx/hal_mcu/hal_lpc13uxx.c
@@ -74,7 +74,7 @@ bool hal_usb_init(void)
void USB_IRQHandler(void)
{
- tusb_isr(0);
+ hal_dcd_isr(0);
}
diff --git a/hw/mcu/nxp/lpc175x_6x/hal_mcu/hal_lpc175x_6x.c b/hw/mcu/nxp/lpc175x_6x/hal_mcu/hal_lpc175x_6x.c
index 5007217d6..0bb9c5411 100644
--- a/hw/mcu/nxp/lpc175x_6x/hal_mcu/hal_lpc175x_6x.c
+++ b/hw/mcu/nxp/lpc175x_6x/hal_mcu/hal_lpc175x_6x.c
@@ -102,7 +102,13 @@ bool hal_usb_init(void)
void USB_IRQHandler(void)
{
- tusb_isr(0);
+ #if MODE_HOST_SUPPORTED
+ hal_hcd_isr(0);
+ #endif
+
+ #if MODE_DEVICE_SUPPORTED
+ hal_dcd_isr(0);
+ #endif
}
#endif
diff --git a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c
index cc34a2cec..666369c1d 100644
--- a/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c
+++ b/hw/mcu/nxp/lpc43xx/tusb_port/dcd_lpc43xx.c
@@ -512,7 +512,7 @@ void xfer_complete_isr(uint8_t coreid, uint32_t reg_complete)
}
}
-void dcd_isr(uint8_t coreid)
+void hal_dcd_isr(uint8_t coreid)
{
LPC_USB0_Type* const lpc_usb = LPC_USB[coreid];
diff --git a/hw/mcu/nxp/lpc43xx/tusb_port/hal_lpc43xx.c b/hw/mcu/nxp/lpc43xx/tusb_port/hal_lpc43xx.c
index dd154d2e4..71b2f19ed 100644
--- a/hw/mcu/nxp/lpc43xx/tusb_port/hal_lpc43xx.c
+++ b/hw/mcu/nxp/lpc43xx/tusb_port/hal_lpc43xx.c
@@ -127,17 +127,31 @@ bool hal_usb_init(void)
return true;
}
+void hal_dcd_isr(uint8_t coreid);
+
#if TUSB_CFG_CONTROLLER_0_MODE
void USB0_IRQHandler(void)
{
- tusb_isr(0);
+ #if MODE_HOST_SUPPORTED
+ hal_hcd_isr(0);
+ #endif
+
+ #if MODE_DEVICE_SUPPORTED
+ hal_dcd_isr(0);
+ #endif
}
#endif
#if TUSB_CFG_CONTROLLER_1_MODE
void USB1_IRQHandler(void)
{
- tusb_isr(1);
+ #if MODE_HOST_SUPPORTED
+ hal_hcd_isr(1);
+ #endif
+
+ #if MODE_DEVICE_SUPPORTED
+ hal_dcd_isr(1);
+ #endif
}
#endif
diff --git a/tinyusb/device/dcd.h b/tinyusb/device/dcd.h
index a2948af52..c6691fab1 100644
--- a/tinyusb/device/dcd.h
+++ b/tinyusb/device/dcd.h
@@ -68,9 +68,6 @@ static inline bool endpointhandle_is_equal(endpoint_handle_t x, endpoint_handle_
return (x.coreid == y.coreid) && (x.index == y.index);
}
-
-void dcd_isr(uint8_t coreid);
-
//------------- Controller API -------------//
bool hal_dcd_init (uint8_t coreid);
void hal_dcd_connect (uint8_t coreid);
diff --git a/tinyusb/device/dcd_lpc175x_6x.c b/tinyusb/device/dcd_lpc175x_6x.c
index 2f5d069a4..e7fbed453 100644
--- a/tinyusb/device/dcd_lpc175x_6x.c
+++ b/tinyusb/device/dcd_lpc175x_6x.c
@@ -216,7 +216,7 @@ static void endpoint_control_isr(void)
LPC_USB->USBEpIntClr = endpoint_int_status; // acknowledge interrupt TODO cannot immediately acknowledge setup packet
}
-void dcd_isr(uint8_t coreid)
+void hal_dcd_isr(uint8_t coreid)
{
(void) coreid;
uint32_t const device_int_enable = LPC_USB->USBDevIntEn;
@@ -402,7 +402,7 @@ bool hal_dcd_control_xfer(uint8_t coreid, tusb_direction_t dir, uint8_t * p_buff
//------------- Status Phase (opposite direct to Data) -------------//
if (dir == TUSB_DIR_HOST_TO_DEV)
- { // only write for CONTROL OUT, CONTROL IN data will be retrieved in dcd_isr // TODO ????
+ { // only write for CONTROL OUT, CONTROL IN data will be retrieved in hal_dcd_isr // TODO ????
VERIFY_STATUS ( pipe_control_write(NULL, 0), false );
}
diff --git a/tinyusb/device/dcd_lpc_11uxx_13uxx.c b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
index 151abe798..167770b96 100644
--- a/tinyusb/device/dcd_lpc_11uxx_13uxx.c
+++ b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
@@ -296,7 +296,7 @@ static void endpoint_control_isr(uint32_t int_status)
}
}
-void dcd_isr(uint8_t coreid)
+void hal_dcd_isr(uint8_t coreid)
{
(void) coreid;
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 167b8f2bf..f76b6c3f3 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -730,7 +730,7 @@ static void xfer_error_isr(uint8_t hostid)
}
//------------- Host Controller Driver's Interrupt Handler -------------//
-void hcd_isr(uint8_t hostid)
+void hal_hcd_isr(uint8_t hostid)
{
ehci_registers_t* const regs = get_operational_register(hostid);
diff --git a/tinyusb/host/hcd.h b/tinyusb/host/hcd.h
index 604b89f7f..57ba7dbbe 100644
--- a/tinyusb/host/hcd.h
+++ b/tinyusb/host/hcd.h
@@ -85,7 +85,7 @@ static inline bool pipehandle_is_equal(pipe_handle_t x, pipe_handle_t y)
// USBH-HCD API
//--------------------------------------------------------------------+
tusb_error_t hcd_init(void) ATTR_WARN_UNUSED_RESULT;
-void hcd_isr(uint8_t hostid);
+void hal_hcd_isr(uint8_t hostid);
//--------------------------------------------------------------------+
// PIPE API
diff --git a/tinyusb/host/ohci/ohci.c b/tinyusb/host/ohci/ohci.c
index ef6da66d5..10998f859 100644
--- a/tinyusb/host/ohci/ohci.c
+++ b/tinyusb/host/ohci/ohci.c
@@ -658,7 +658,7 @@ static void done_queue_isr(uint8_t hostid)
}
}
-void hcd_isr(uint8_t hostid)
+void hal_hcd_isr(uint8_t hostid)
{
uint32_t const int_en = OHCI_REG->interrupt_enable;
uint32_t const int_status = OHCI_REG->interrupt_status & int_en;
diff --git a/tinyusb/tusb.c b/tinyusb/tusb.c
index 156aecee5..0e54b4206 100644
--- a/tinyusb/tusb.c
+++ b/tinyusb/tusb.c
@@ -63,23 +63,6 @@ tusb_error_t tusb_init(void)
return TUSB_ERROR_NONE;
}
-/** \ingroup group_application_api
- * \brief USB interrupt handler
- * \param[in] coreid Controller ID where the interrupt happened
- * \note This function must be called by HAL layer or Application for the stack to manage USB events/transfers.
- */
-void tusb_isr(uint8_t coreid)
-{
-#if MODE_HOST_SUPPORTED
- hcd_isr(coreid);
-#endif
-
-#if MODE_DEVICE_SUPPORTED
- dcd_isr(coreid);
-#endif
-
-}
-
#if TUSB_CFG_OS == TUSB_OS_NONE
void tusb_task_runner(void)
{
diff --git a/tinyusb/tusb.h b/tinyusb/tusb.h
index ba082247b..9ff1f5e2a 100644
--- a/tinyusb/tusb.h
+++ b/tinyusb/tusb.h
@@ -102,8 +102,6 @@
*/
tusb_error_t tusb_init(void);
-void tusb_isr(uint8_t coreid);
-
#if TUSB_CFG_OS == TUSB_OS_NONE
/** \brief Run all tinyusb's internal tasks (e.g host task, device task).
* \note This function is only required when using no RTOS (\ref TUSB_CFG_OS == TUSB_OS_NONE). All the stack functions