diff options
| author | hathach <[email protected]> | 2021-10-01 22:20:50 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-10-01 22:53:14 +0700 |
| commit | 75ad0c7d310bf49b70e737d82b86b7ad4be1f167 (patch) | |
| tree | 40f066a350a74836ae05b7f45b5a142ae43090fb /src | |
| parent | fdd1e4fbf03726703cba701f9ea7d9541e9bab9e (diff) | |
clean up
Diffstat (limited to 'src')
| -rw-r--r-- | src/device/usbd_pvt.h | 4 | ||||
| -rw-r--r-- | src/host/usbh.c | 9 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/device/usbd_pvt.h b/src/device/usbd_pvt.h index f66429a02..7607b9895 100644 --- a/src/device/usbd_pvt.h +++ b/src/device/usbd_pvt.h @@ -43,10 +43,6 @@ typedef struct char const* name; #endif - // Minimum number of Interfaces for this driver to work. - // Only needed for driver use 2 or more interfaces without IAD - uint8_t itf_count_min; - void (* init ) (void); void (* reset ) (uint8_t rhport); uint16_t (* open ) (uint8_t rhport, tusb_desc_interface_t const * desc_intf, uint16_t max_len); diff --git a/src/host/usbh.c b/src/host/usbh.c index 100a17aa4..2ef936ad0 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -1000,9 +1000,6 @@ static bool parse_configuration_descriptor(uint8_t dev_addr, tusb_desc_configura TU_ASSERT( TUSB_DESC_INTERFACE == tu_desc_type(p_desc) ); tusb_desc_interface_t const* desc_itf = (tusb_desc_interface_t const*) p_desc; - // Interface number must not be used already - TU_ASSERT( DRVID_INVALID == dev->itf2drv[desc_itf->bInterfaceNumber] ); - #if CFG_TUH_MIDI // MIDI has 2 interfaces (Audio Control v1 + MIDIStreaming) but does not have IAD // manually increase the associated count @@ -1040,7 +1037,11 @@ static bool parse_configuration_descriptor(uint8_t dev_addr, tusb_desc_configura // bind (associated) interfaces to found driver for(uint8_t i=0; i<assoc_itf_count; i++) { - dev->itf2drv[desc_itf->bInterfaceNumber+i] = drv_id; + uint8_t const itf_num = desc_itf->bInterfaceNumber+i; + + // Interface number must not be used already + TU_ASSERT( DRVID_INVALID == dev->itf2drv[itf_num] ); + dev->itf2drv[itf_num] = drv_id; } // bind all endpoints to found driver |
