diff options
| author | hathach <[email protected]> | 2020-11-24 21:49:12 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2020-11-24 21:49:12 +0700 |
| commit | 148eea141798cd9aefea49aaedc06c885ab7a3aa (patch) | |
| tree | b3f01aadf3ffe84355a2f4ede31f212ecc306e11 /src/device/usbd.c | |
| parent | 2bfcd446a58d987d2275774c985471198cf43328 (diff) | |
add tud_connected()
which return true as long as we receive the very first SETUP packet from
host.
Diffstat (limited to 'src/device/usbd.c')
| -rw-r--r-- | src/device/usbd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/device/usbd.c b/src/device/usbd.c index 15174f2ab..4ecc2a2f9 100644 --- a/src/device/usbd.c +++ b/src/device/usbd.c @@ -326,9 +326,14 @@ tusb_speed_t tud_speed_get(void) return (tusb_speed_t) _usbd_dev.speed; } +bool tud_connected(void) +{ + return _usbd_dev.connected; +} + bool tud_mounted(void) { - return _usbd_dev.cfg_num ? 1 : 0; + return _usbd_dev.cfg_num ? true : false; } bool tud_suspended(void) |
