37
37
// USBH Configuration
38
38
//--------------------------------------------------------------------+
39
39
40
- // TODO remove,update
41
- #ifndef CFG_TUH_EP_MAX
42
- #define CFG_TUH_EP_MAX 9
43
- #endif
44
-
45
40
#ifndef CFG_TUH_TASK_QUEUE_SZ
46
41
#define CFG_TUH_TASK_QUEUE_SZ 16
47
42
#endif
@@ -72,7 +67,7 @@ typedef struct
72
67
} usbh_dev0_t ;
73
68
74
69
typedef struct {
75
- // port
70
+ // port, must be same layout as usbh_dev0_t
76
71
uint8_t rhport ;
77
72
uint8_t hub_addr ;
78
73
uint8_t hub_port ;
@@ -102,7 +97,7 @@ typedef struct {
102
97
volatile uint8_t state ; // device state, value from enum tusbh_device_state_t
103
98
104
99
uint8_t itf2drv [16 ]; // map interface number to driver (0xff is invalid)
105
- uint8_t ep2drv [CFG_TUH_EP_MAX ][2 ]; // map endpoint to driver ( 0xff is invalid )
100
+ uint8_t ep2drv [CFG_TUH_ENDPOINT_MAX ][2 ]; // map endpoint to driver ( 0xff is invalid )
106
101
107
102
struct TU_ATTR_PACKED
108
103
{
@@ -111,7 +106,7 @@ typedef struct {
111
106
volatile bool claimed : 1 ;
112
107
113
108
// TODO merge ep2drv here, 4-bit should be sufficient
114
- }ep_status [CFG_TUH_EP_MAX ][2 ];
109
+ }ep_status [CFG_TUH_ENDPOINT_MAX ][2 ];
115
110
116
111
// Mutex for claiming endpoint, only needed when using with preempted RTOS
117
112
#if CFG_TUSB_OS != OPT_OS_NONE
@@ -344,6 +339,8 @@ bool tuh_init(uint8_t rhport)
344
339
345
340
TU_LOG2 ("USBH init\r\n" );
346
341
342
+ TU_LOG2_INT (sizeof (usbh_device_t ));
343
+
347
344
tu_memclr (_usbh_devices , sizeof (_usbh_devices ));
348
345
tu_memclr (& _dev0 , sizeof (_dev0 ));
349
346
0 commit comments