summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2020-07-24 01:28:49 +0700
committerGitHub <[email protected]>2020-07-24 01:28:49 +0700
commit60355720364f66fff7856c3de1d18382f7912e31 (patch)
tree792ac21e71f560e5dc2d2eb109eb4cbed8366acb /src
parent72c5167fa5a57e57aa1047c7046a3d2354a1b610 (diff)
parent503c15217edad86426db4792364b88b35ec04d31 (diff)
Merge pull request #471 from hathach/call-usbinit-after-kernel-started
call tud_init() after freeRTOS kernel is started
Diffstat (limited to 'src')
-rw-r--r--src/device/usbd.h2
-rw-r--r--src/host/usbh.h3
-rw-r--r--src/tusb.h2
3 files changed, 7 insertions, 0 deletions
diff --git a/src/device/usbd.h b/src/device/usbd.h
index d9facf719..098e94075 100644
--- a/src/device/usbd.h
+++ b/src/device/usbd.h
@@ -42,6 +42,8 @@
//--------------------------------------------------------------------+
// Init device stack
+// Note: when using with RTOS, this should be called after scheduler/kernel is started.
+// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
bool tud_init (void);
// Task function should be called in main/rtos loop
diff --git a/src/host/usbh.h b/src/host/usbh.h
index 42a2bd095..fe39a19f4 100644
--- a/src/host/usbh.h
+++ b/src/host/usbh.h
@@ -91,6 +91,9 @@ TU_ATTR_WEAK void tuh_umount_cb(uint8_t dev_addr);
//--------------------------------------------------------------------+
// CLASS-USBH & INTERNAL API
//--------------------------------------------------------------------+
+
+// Note: when using with RTOS, this should be called after scheduler/kernel is started.
+// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
bool usbh_init(void);
bool usbh_control_xfer (uint8_t dev_addr, tusb_control_request_t* request, uint8_t* data);
diff --git a/src/tusb.h b/src/tusb.h
index defbc54fb..c252a5789 100644
--- a/src/tusb.h
+++ b/src/tusb.h
@@ -109,6 +109,8 @@
* @{ */
// Initialize device/host stack
+// Note: when using with RTOS, this should be called after scheduler/kernel is started.
+// Otherwise it could cause kernel issue since USB IRQ handler does use RTOS queue API.
bool tusb_init(void);
// Check if stack is initialized