mirror of
https://github.com/hathach/tinyusb.git
synced 2025-04-10 12:44:55 +00:00
test ok with cdc and msc
This commit is contained in:
parent
bae570f7c7
commit
e713b534fa
@ -223,11 +223,11 @@ void cdcd_reset(uint8_t rhport)
|
|||||||
bool cdcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_length)
|
bool cdcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_length)
|
||||||
{
|
{
|
||||||
// Only support ACM subclass
|
// Only support ACM subclass
|
||||||
TU_ASSERT ( CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL == itf_desc->bInterfaceSubClass);
|
TU_VERIFY ( TUSB_CLASS_CDC == itf_desc->bInterfaceClass &&
|
||||||
|
CDC_COMM_SUBCLASS_ABSTRACT_CONTROL_MODEL == itf_desc->bInterfaceSubClass);
|
||||||
|
|
||||||
// Only support AT commands, no protocol and vendor specific commands.
|
// Note: 0xFF can be used with RNDIS
|
||||||
TU_ASSERT(tu_within(CDC_COMM_PROTOCOL_NONE, itf_desc->bInterfaceProtocol, CDC_COMM_PROTOCOL_ATCOMMAND_CDMA) ||
|
TU_VERIFY(tu_within(CDC_COMM_PROTOCOL_NONE, itf_desc->bInterfaceProtocol, CDC_COMM_PROTOCOL_ATCOMMAND_CDMA));
|
||||||
itf_desc->bInterfaceProtocol == 0xff);
|
|
||||||
|
|
||||||
// Find available interface
|
// Find available interface
|
||||||
cdcd_interface_t * p_cdc = NULL;
|
cdcd_interface_t * p_cdc = NULL;
|
||||||
|
@ -160,7 +160,7 @@ void hidd_reset(uint8_t rhport)
|
|||||||
|
|
||||||
bool hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t *p_len)
|
bool hidd_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t *p_len)
|
||||||
{
|
{
|
||||||
TU_VERIFY(desc_itf->bInterfaceClass == TUSB_CLASS_HID);
|
TU_VERIFY(TUSB_CLASS_HID == desc_itf->bInterfaceClass);
|
||||||
|
|
||||||
uint8_t const *p_desc = (uint8_t const *) desc_itf;
|
uint8_t const *p_desc = (uint8_t const *) desc_itf;
|
||||||
|
|
||||||
|
@ -157,7 +157,8 @@ void mscd_reset(uint8_t rhport)
|
|||||||
bool mscd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_len)
|
bool mscd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_len)
|
||||||
{
|
{
|
||||||
// only support SCSI's BOT protocol
|
// only support SCSI's BOT protocol
|
||||||
TU_ASSERT(MSC_SUBCLASS_SCSI == itf_desc->bInterfaceSubClass &&
|
TU_VERIFY(TUSB_CLASS_MSC == itf_desc->bInterfaceClass &&
|
||||||
|
MSC_SUBCLASS_SCSI == itf_desc->bInterfaceSubClass &&
|
||||||
MSC_PROTOCOL_BOT == itf_desc->bInterfaceProtocol);
|
MSC_PROTOCOL_BOT == itf_desc->bInterfaceProtocol);
|
||||||
|
|
||||||
mscd_interface_t * p_msc = &_mscd_itf;
|
mscd_interface_t * p_msc = &_mscd_itf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user