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