File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 41
41
#define CFG_TUH_TASK_QUEUE_SZ 16
42
42
#endif
43
43
44
+ #ifndef CFG_TUH_INTERFACE_MAX
45
+ #define CFG_TUH_INTERFACE_MAX 8
46
+ #endif
47
+
44
48
// Debug level of USBD
45
49
#define USBH_DBG_LVL 2
46
50
@@ -96,7 +100,7 @@ typedef struct {
96
100
//------------- device -------------//
97
101
volatile uint8_t state ; // device state, value from enum tusbh_device_state_t
98
102
99
- uint8_t itf2drv [8 ]; // map interface number to driver (0xff is invalid)
103
+ uint8_t itf2drv [CFG_TUH_INTERFACE_MAX ]; // map interface number to driver (0xff is invalid)
100
104
uint8_t ep2drv [CFG_TUH_ENDPOINT_MAX ][2 ]; // map endpoint to driver ( 0xff is invalid )
101
105
102
106
struct TU_ATTR_PACKED
@@ -665,7 +669,7 @@ void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num)
665
669
{
666
670
usbh_device_t * dev = get_device (dev_addr );
667
671
668
- for (itf_num ++ ; itf_num < sizeof ( dev -> itf2drv ) ; itf_num ++ )
672
+ for (itf_num ++ ; itf_num < CFG_TUH_INTERFACE_MAX ; itf_num ++ )
669
673
{
670
674
// continue with next valid interface
671
675
// TODO skip IAD binding interface such as CDCs
@@ -680,7 +684,7 @@ void usbh_driver_set_config_complete(uint8_t dev_addr, uint8_t itf_num)
680
684
}
681
685
682
686
// all interface are configured
683
- if (itf_num == sizeof ( dev -> itf2drv ) )
687
+ if (itf_num == CFG_TUH_INTERFACE_MAX )
684
688
{
685
689
// Invoke callback if available
686
690
if (tuh_mount_cb ) tuh_mount_cb (dev_addr );
You can’t perform that action at this time.
0 commit comments