summaryrefslogtreecommitdiff
path: root/src/device
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-01-29 20:13:17 +0700
committerGitHub <[email protected]>2019-01-29 20:13:17 +0700
commit29b49199beb8e9b5fead83e5cd36105f8746f1d7 (patch)
tree5fec0508a84fd7b75b21b16b13ef6181d97eaaa5 /src/device
parentbd5325612620209e7964f10817a57f916d3bc13f (diff)
parent1a84f5da5496e7ea410e9023253b30933c207159 (diff)
Merge pull request #34 from hathach/develop
add tusb_inited(), better compatible with nrf SD
Diffstat (limited to 'src/device')
-rw-r--r--src/device/usbd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c
index 9c08a7932..5baea8460 100644
--- a/src/device/usbd.c
+++ b/src/device/usbd.c
@@ -61,7 +61,7 @@ typedef struct {
}usbd_device_t;
-static usbd_device_t _usbd_dev;
+static usbd_device_t _usbd_dev = { 0 };
// Auto descriptor is enabled, descriptor set point to auto generated one
#if CFG_TUD_DESC_AUTO
@@ -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)
{