File tree Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Expand file tree Collapse file tree 4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 40
40
//--------------------------------------------------------------------+
41
41
42
42
#ifndef CFG_TUH_ENDPOINT_MAX
43
- #define CFG_TUH_ENDPOINT_MAX (CFG_TUH_DEVICE_MAX*( CFG_TUH_HUB + CFG_TUH_HID*2 + CFG_TUH_MSC*2 + CFG_TUH_CDC*3) )
43
+ #define CFG_TUH_ENDPOINT_MAX (CFG_TUH_HUB + CFG_TUH_HID*2 + CFG_TUH_MSC*2 + CFG_TUH_CDC*3)
44
44
// #ifdef TUP_HCD_ENDPOINT_MAX
45
45
// #define CFG_TUH_ENDPPOINT_MAX TUP_HCD_ENDPOINT_MAX
46
46
// #else
Original file line number Diff line number Diff line change 58
58
59
59
#define FRAMELIST_SIZE (1024 >> FRAMELIST_SIZE_BIT_VALUE)
60
60
61
- #define HCD_MAX_XFER CFG_TUH_ENDPOINT_MAX
61
+ #define QHD_MAX (CFG_TUH_DEVICE_MAX*CFG_TUH_ENDPOINT_MAX)
62
+ #define QTD_MAX QHD_MAX
62
63
63
64
typedef struct
64
65
{
@@ -76,7 +77,7 @@ typedef struct
76
77
}control [CFG_TUH_DEVICE_MAX + CFG_TUH_HUB + 1 ];
77
78
78
79
ehci_qhd_t qhd_pool [CFG_TUH_ENDPOINT_MAX ];
79
- ehci_qtd_t qtd_pool [HCD_MAX_XFER ] TU_ATTR_ALIGNED (32 );
80
+ ehci_qtd_t qtd_pool [QTD_MAX ] TU_ATTR_ALIGNED (32 );
80
81
81
82
ehci_registers_t * regs ;
82
83
@@ -752,7 +753,7 @@ static inline ehci_qhd_t* qhd_get_from_addr(uint8_t dev_addr, uint8_t ep_addr)
752
753
//------------- TD helper -------------//
753
754
static inline ehci_qtd_t * qtd_find_free (void )
754
755
{
755
- for (uint32_t i = 0 ; i < HCD_MAX_XFER ; i ++ )
756
+ for (uint32_t i = 0 ; i < QTD_MAX ; i ++ )
756
757
{
757
758
if ( !ehci_data .qtd_pool [i ].used ) return & ehci_data .qtd_pool [i ];
758
759
}
Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ static ohci_ed_t * ed_from_addr(uint8_t dev_addr, uint8_t ep_addr)
313
313
314
314
ohci_ed_t * ed_pool = ohci_data .ed_pool ;
315
315
316
- for (uint32_t i = 0 ; i < CFG_TUH_ENDPOINT_MAX ; i ++ )
316
+ for (uint32_t i = 0 ; i < ED_MAX ; i ++ )
317
317
{
318
318
if ( (ed_pool [i ].dev_addr == dev_addr ) &&
319
319
ep_addr == tu_edpt_addr (ed_pool [i ].ep_number , ed_pool [i ].pid == PID_IN ) )
@@ -329,7 +329,7 @@ static ohci_ed_t * ed_find_free(void)
329
329
{
330
330
ohci_ed_t * ed_pool = ohci_data .ed_pool ;
331
331
332
- for (uint8_t i = 0 ; i < CFG_TUH_ENDPOINT_MAX ; i ++ )
332
+ for (uint8_t i = 0 ; i < ED_MAX ; i ++ )
333
333
{
334
334
if ( !ed_pool [i ].used ) return & ed_pool [i ];
335
335
}
@@ -368,7 +368,7 @@ static void ed_list_remove_by_addr(ohci_ed_t * p_head, uint8_t dev_addr)
368
368
369
369
static ohci_gtd_t * gtd_find_free (void )
370
370
{
371
- for (uint8_t i = 0 ; i < HCD_MAX_XFER ; i ++ )
371
+ for (uint8_t i = 0 ; i < GTD_MAX ; i ++ )
372
372
{
373
373
if ( !ohci_data .gtd_pool [i ].used ) return & ohci_data .gtd_pool [i ];
374
374
}
Original file line number Diff line number Diff line change 42
42
OHCI_MAX_ITD = 4
43
43
};
44
44
45
- #define HCD_MAX_XFER CFG_TUH_ENDPOINT_MAX
45
+ #define ED_MAX (CFG_TUH_DEVICE_MAX*CFG_TUH_ENDPOINT_MAX)
46
+ #define GTD_MAX ED_MAX
46
47
47
48
//--------------------------------------------------------------------+
48
49
// OHCI Data Structure
@@ -165,7 +166,7 @@ typedef struct TU_ATTR_ALIGNED(256)
165
166
166
167
// ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32
167
168
ohci_ed_t ed_pool [CFG_TUH_ENDPOINT_MAX ];
168
- ohci_gtd_t gtd_pool [HCD_MAX_XFER ];
169
+ ohci_gtd_t gtd_pool [GTD_MAX ];
169
170
170
171
volatile uint16_t frame_number_hi ;
171
172
You can’t perform that action at this time.
0 commit comments