diff options
| author | hathach <[email protected]> | 2022-03-20 00:51:00 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2022-03-20 00:51:00 +0700 |
| commit | 45052c625e962fa908c3234c228fca43181436d6 (patch) | |
| tree | ebc895fc17fe056108af39e90e8b87ed6b09d895 /src/portable/ohci | |
| parent | c0195fc6270394a489faf29fe8fc42dff48bcff1 (diff) | |
| parent | ae531a79f654d566790a4daae350730cdc0a01e9 (diff) | |
Merge branch 'master' into pio-host
Diffstat (limited to 'src/portable/ohci')
| -rw-r--r-- | src/portable/ohci/ohci.c | 6 | ||||
| -rw-r--r-- | src/portable/ohci/ohci.h | 7 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/portable/ohci/ohci.c b/src/portable/ohci/ohci.c index db087716f..3e523ebc2 100644 --- a/src/portable/ohci/ohci.c +++ b/src/portable/ohci/ohci.c @@ -318,7 +318,7 @@ static ohci_ed_t * ed_from_addr(uint8_t dev_addr, uint8_t ep_addr) ohci_ed_t* ed_pool = ohci_data.ed_pool; - for(uint32_t i=0; i<HCD_MAX_ENDPOINT; i++) + for(uint32_t i=0; i<ED_MAX; i++) { if ( (ed_pool[i].dev_addr == dev_addr) && ep_addr == tu_edpt_addr(ed_pool[i].ep_number, ed_pool[i].pid == PID_IN) ) @@ -334,7 +334,7 @@ static ohci_ed_t * ed_find_free(void) { ohci_ed_t* ed_pool = ohci_data.ed_pool; - for(uint8_t i = 0; i < HCD_MAX_ENDPOINT; i++) + for(uint8_t i = 0; i < ED_MAX; i++) { if ( !ed_pool[i].used ) return &ed_pool[i]; } @@ -373,7 +373,7 @@ static void ed_list_remove_by_addr(ohci_ed_t * p_head, uint8_t dev_addr) static ohci_gtd_t * gtd_find_free(void) { - for(uint8_t i=0; i < HCD_MAX_XFER; i++) + for(uint8_t i=0; i < GTD_MAX; i++) { if ( !ohci_data.gtd_pool[i].used ) return &ohci_data.gtd_pool[i]; } diff --git a/src/portable/ohci/ohci.h b/src/portable/ohci/ohci.h index 8db097b06..9fc954c8f 100644 --- a/src/portable/ohci/ohci.h +++ b/src/portable/ohci/ohci.h @@ -42,6 +42,9 @@ enum { OHCI_MAX_ITD = 4 }; +#define ED_MAX (CFG_TUH_DEVICE_MAX*CFG_TUH_ENDPOINT_MAX) +#define GTD_MAX ED_MAX + //--------------------------------------------------------------------+ // OHCI Data Structure //--------------------------------------------------------------------+ @@ -162,8 +165,8 @@ typedef struct TU_ATTR_ALIGNED(256) }control[CFG_TUH_DEVICE_MAX+CFG_TUH_HUB+1]; // ochi_itd_t itd[OHCI_MAX_ITD]; // itd requires alignment of 32 - ohci_ed_t ed_pool[HCD_MAX_ENDPOINT]; - ohci_gtd_t gtd_pool[HCD_MAX_XFER]; + ohci_ed_t ed_pool[ED_MAX]; + ohci_gtd_t gtd_pool[GTD_MAX]; volatile uint16_t frame_number_hi; |
