create new name for multiple port API, to simplify API

This commit is contained in:
hathach
2018-03-11 19:37:21 +07:00
parent a55fcece4c
commit 08ea1c35cb
6 changed files with 59 additions and 25 deletions

View File

@@ -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;
}
//--------------------------------------------------------------------+

View File

@@ -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