From e4e8413acc6b293b620cae762fd4ea45c5de1cd1 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 29 Jan 2019 19:05:07 +0700 Subject: add tusb_inited() API, check for inited() before running device/host task --- src/device/usbd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/device/usbd.c') diff --git a/src/device/usbd.c b/src/device/usbd.c index 9c08a7932..d4eccf0c4 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -240,6 +240,9 @@ static void usbd_reset(uint8_t rhport) */ void tud_task (void) { + // Skip if stack is not initialized + if ( !tusb_inited() ) return; + // Loop until there is no more events in the queue while (1) { -- cgit v1.3.1