diff options
| author | hathach <[email protected]> | 2019-03-05 05:45:42 -0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-03-05 05:45:42 -0800 |
| commit | 8418cb816bbc0b760c102921875016a8ba31167d (patch) | |
| tree | c9c0e1718779d889aaa47979f3c5b3c4d423297b /src/device | |
| parent | 49aa6ec2516eddb2202c82a415b89be919bf1dd1 (diff) | |
| parent | a19455d1ff2581b07b1ace00f5a2820165bd8e98 (diff) | |
Merge branch 'master' into stm32f4
Diffstat (limited to 'src/device')
| -rw-r--r-- | src/device/usbd.c | 5 |
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)
{
|
