diff options
| author | hathach <[email protected]> | 2019-01-29 20:13:17 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-01-29 20:13:17 +0700 |
| commit | 29b49199beb8e9b5fead83e5cd36105f8746f1d7 (patch) | |
| tree | 5fec0508a84fd7b75b21b16b13ef6181d97eaaa5 /src/device | |
| parent | bd5325612620209e7964f10817a57f916d3bc13f (diff) | |
| parent | 1a84f5da5496e7ea410e9023253b30933c207159 (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.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)
{
|
