summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c14
-rw-r--r--src/host/usbh_classdriver.h2
2 files changed, 15 insertions, 1 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index b8439addc..9854b75a3 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -215,7 +215,7 @@ CFG_TUSB_MEM_SECTION usbh_device_t _usbh_devices[CFG_TUH_DEVICE_MAX + CFG_TUH_HU
// Event queue
// role device/host is used by OS NONE for mutex (disable usb isr)
-OSAL_QUEUE_DEF(OPT_MODE_HOST, _usbh_qdef, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
+OSAL_QUEUE_DEF(usbh_int_set, _usbh_qdef, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
static osal_queue_t _usbh_q;
CFG_TUSB_MEM_SECTION CFG_TUSB_MEM_ALIGN static uint8_t _usbh_ctrl_buf[CFG_TUH_ENUMERATION_BUFSIZE];
@@ -434,6 +434,18 @@ uint8_t* usbh_get_enum_buf(void)
return _usbh_ctrl_buf;
}
+void usbh_int_set(bool enabled)
+{
+ // TODO all host controller
+ if (enabled)
+ {
+ hcd_int_enable(TUH_OPT_RHPORT);
+ }else
+ {
+ hcd_int_disable(TUH_OPT_RHPORT);
+ }
+}
+
//--------------------------------------------------------------------+
// HCD Event Handler
//--------------------------------------------------------------------+
diff --git a/src/host/usbh_classdriver.h b/src/host/usbh_classdriver.h
index 8bc2622aa..2f9957cc6 100644
--- a/src/host/usbh_classdriver.h
+++ b/src/host/usbh_classdriver.h
@@ -57,6 +57,8 @@ uint8_t usbh_get_rhport(uint8_t dev_addr);
uint8_t* usbh_get_enum_buf(void);
+void usbh_int_set(bool enabled);
+
//--------------------------------------------------------------------+
// USBH Endpoint API
//--------------------------------------------------------------------+