summaryrefslogtreecommitdiff
path: root/tinyusb/hal
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-04 18:46:02 +0700
committerhathach <[email protected]>2013-03-04 18:46:02 +0700
commit2c8596edebaedd0ceae46a56385c71c83dda531c (patch)
treede683bd9a77da9906879aa8e21d3cc546407b3c4 /tinyusb/hal
parenta259be6edf5bb0f8c4e77f3b321a826d8e86bd25 (diff)
abstract call chains from hal usb isr
Diffstat (limited to 'tinyusb/hal')
-rw-r--r--tinyusb/hal/hal.h4
-rw-r--r--tinyusb/hal/hal_lpc43xx.c14
-rw-r--r--tinyusb/hal/hal_lpc43xx.h3
3 files changed, 18 insertions, 3 deletions
diff --git a/tinyusb/hal/hal.h b/tinyusb/hal/hal.h
index 9afad4726..ad77055eb 100644
--- a/tinyusb/hal/hal.h
+++ b/tinyusb/hal/hal.h
@@ -68,6 +68,10 @@
extern "C" {
#endif
+// callback from tusb.h
+extern void tusb_isr(uint8_t controller_id);
+
+
/** \brief USB hardware init
*
* \param[in] para1
diff --git a/tinyusb/hal/hal_lpc43xx.c b/tinyusb/hal/hal_lpc43xx.c
index f7280041e..770ffd4ce 100644
--- a/tinyusb/hal/hal_lpc43xx.c
+++ b/tinyusb/hal/hal_lpc43xx.c
@@ -54,4 +54,18 @@ tusb_error_t hal_init()
return TUSB_ERROR_NONE;
}
+void USB0_IRQHandler(void)
+{
+#if TUSB_CFG_CONTROLLER0_MODE
+ tusb_isr(0);
+#endif
+}
+
+void USB1_IRQHandler(void)
+{
+#if TUSB_CFG_CONTROLLER1_MODE
+ tusb_isr(1);
+#endif
+}
+
#endif
diff --git a/tinyusb/hal/hal_lpc43xx.h b/tinyusb/hal/hal_lpc43xx.h
index 0d9e4c8be..63da8a37c 100644
--- a/tinyusb/hal/hal_lpc43xx.h
+++ b/tinyusb/hal/hal_lpc43xx.h
@@ -61,9 +61,6 @@
#define DEVICE_ROM_REG_BASE LPC_USB0_BASE // TODO USB1
#define DEVICE_ROM_DRIVER_ADDR 0x1040011C
-#define tusb_1st_isr USB0_IRQHandler
-#define tusb_2nd_isr
-
static inline void hal_interrupt_enable()
{
NVIC_EnableIRQ(USB0_IRQn); // TODO USB1