mirror of
https://github.com/hathach/tinyusb.git
synced 2025-01-31 05:52:55 +08:00
Merge pull request #561 from hathach/add-tud-connected
add tud_connected()
This commit is contained in:
commit
218b80e63a
@ -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)
|
||||
|
@ -56,6 +56,9 @@ extern void dcd_int_handler(uint8_t rhport);
|
||||
// Get current bus speed
|
||||
tusb_speed_t tud_speed_get(void);
|
||||
|
||||
// Check if device is connected (may not mounted/configured yet)
|
||||
bool tud_connected(void);
|
||||
|
||||
// Check if device is connected and configured
|
||||
bool tud_mounted(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user