test with tmc

This commit is contained in:
hathach 2020-04-15 10:37:31 +07:00
parent e713b534fa
commit c1c9ca5629
No known key found for this signature in database
GPG Key ID: 2FA891220FBFD581
1 changed files with 5 additions and 3 deletions

View File

@ -263,17 +263,19 @@ void usbtmcd_init_cb(void)
bool usbtmcd_open_cb(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t *p_length)
{
(void)rhport;
TU_ASSERT(usbtmc_state.state == STATE_CLOSED);
uint8_t const * p_desc;
uint8_t found_endpoints = 0;
TU_VERIFY(itf_desc->bInterfaceClass == TUD_USBTMC_APP_CLASS);
TU_VERIFY(itf_desc->bInterfaceSubClass == TUD_USBTMC_APP_SUBCLASS);
#ifndef NDEBUG
TU_ASSERT(itf_desc->bInterfaceClass == TUD_USBTMC_APP_CLASS);
TU_ASSERT(itf_desc->bInterfaceSubClass == TUD_USBTMC_APP_SUBCLASS);
// Only 2 or 3 endpoints are allowed for USBTMC.
TU_ASSERT((itf_desc->bNumEndpoints == 2) || (itf_desc->bNumEndpoints ==3));
#endif
TU_ASSERT(usbtmc_state.state == STATE_CLOSED);
// Interface
(*p_length) = 0u;
p_desc = (uint8_t const *) itf_desc;