add tusbh_cdc_serial_is_mounted API

test for cdch close driver
This commit is contained in:
hathach
2013-07-02 15:32:41 +07:00
parent b04b145965
commit 7e5c6ded2d
4 changed files with 48 additions and 3 deletions
+12
View File
@@ -57,6 +57,18 @@
//--------------------------------------------------------------------+
/*STATIC_*/ cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
// APPLICATION API (parameter validation needed)
//--------------------------------------------------------------------+
bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr)
{
// TODO consider all AT Command as serial candidate
return
(tusbh_device_get_mounted_class_flag(dev_addr) & BIT_(TUSB_CLASS_CDC) ) &&
(CDC_COMM_PROTOCOL_ATCOMMAND <= cdch_data[dev_addr-1].interface_protocol) &&
(cdch_data[dev_addr-1].interface_protocol <= CDC_COMM_PROTOCOL_ATCOMMAND_CDMA);
}
//--------------------------------------------------------------------+
// USBH-CLASS DRIVER API
//--------------------------------------------------------------------+
+2 -2
View File
@@ -57,11 +57,11 @@
//--------------------------------------------------------------------+
// APPLICATION PUBLIC API
//--------------------------------------------------------------------+
bool tusbh_cdc_acm_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
//bool tusbh_cdc_acm_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
bool tusbh_cdc_serial_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
bool tusbh_cdc_rndis_is_mounted(uint8_t dev_addr) ATTR_PURE ATTR_WARN_UNUSED_RESULT;
tusb_interface_status_t tusbh_cdc_send(void const * p_data, uint32_t length);
tusb_interface_status_t tusbh_cdc_send(void const * p_data, uint32_t length, bool is_notify);
//--------------------------------------------------------------------+
// USBH-CLASS API
+1 -1
View File
@@ -964,7 +964,7 @@ static ehci_link_t* list_find_previous_item(ehci_link_t* p_head, ehci_link_t* p_
uint32_t max_loop = 0;
while( (align32(p_prev->address) != (uint32_t) p_head) && // not loop around
(align32(p_prev->address) != (uint32_t) p_current) && // not found yet
!p_prev->terminate && // not advancable
!p_prev->terminate && // not advanceable
max_loop < EHCI_MAX_QHD)
{
p_prev = list_next(p_prev);