summaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-01-29 19:05:07 +0700
committerhathach <[email protected]>2019-01-29 19:05:07 +0700
commite4e8413acc6b293b620cae762fd4ea45c5de1cd1 (patch)
tree3ff0d6a9008f67ebb22310375d10ef12e8d5bc1a /src/host
parent777f41a066315c2c0d9e5c98773363937a9c920d (diff)
add tusb_inited() API, check for inited() before running device/host task
Diffstat (limited to 'src/host')
-rw-r--r--src/host/usbh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 4334729e9..a7e7c2acd 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -620,6 +620,9 @@ bool enum_task(hcd_event_t* event)
*/
void tuh_task(void)
{
+ // Skip if stack is not initialized
+ if ( !tusb_inited() ) return;
+
// Loop until there is no more events in the queue
while (1)
{