diff options
| author | hathach <[email protected]> | 2018-03-11 19:37:21 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-03-11 19:37:21 +0700 |
| commit | 08ea1c35cbc42fcf47c815a7ed1f9e35e9b74bf4 (patch) | |
| tree | f127ba312e92828119057d0793902eddb9b87563 /tinyusb/device | |
| parent | a55fcece4cc58461da401c720ce652c8a8c810aa (diff) | |
create new name for multiple port API, to simplify API
Diffstat (limited to 'tinyusb/device')
| -rw-r--r-- | tinyusb/device/usbd.c | 4 | ||||
| -rw-r--r-- | tinyusb/device/usbd.h | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tinyusb/device/usbd.c b/tinyusb/device/usbd.c index 2ae86ef8d..3220fdac4 100644 --- a/tinyusb/device/usbd.c +++ b/tinyusb/device/usbd.c @@ -108,9 +108,9 @@ static tusb_error_t get_descriptor(uint8_t port, tusb_control_request_t const * //--------------------------------------------------------------------+
// APPLICATION INTERFACE
//--------------------------------------------------------------------+
-bool tud_mounted(uint8_t port)
+bool tud_n_mounted(uint8_t port)
{
- return usbd_devices[port].state == TUSB_DEVICE_STATE_CONFIGURED;
+ return usbd_devices[port].state == TUSB_DEVICE_STATE_CONFIGURED;
}
//--------------------------------------------------------------------+
diff --git a/tinyusb/device/usbd.h b/tinyusb/device/usbd.h index 8258abfdf..f16a0215b 100644 --- a/tinyusb/device/usbd.h +++ b/tinyusb/device/usbd.h @@ -100,7 +100,13 @@ typedef struct { //--------------------------------------------------------------------+
// APPLICATION API
//--------------------------------------------------------------------+
-bool tud_mounted(uint8_t port);
+bool tud_n_mounted(uint8_t port);
+
+static inline bool tud_mounted(void)
+{
+ return tud_n_mounted(0);
+}
+
/*------------- Callback -------------*/
/** \brief Callback function that will be invoked device is mounted (configured) by USB host
|
