diff options
| author | hathach <[email protected]> | 2013-04-21 16:24:42 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-04-21 16:24:42 +0700 |
| commit | ee9d53477ae74dd9730d1fbca1a0fad69027479b (patch) | |
| tree | 909fb2ec0fc0d5f04d58c308c23a3798dc5887bf /tinyusb | |
| parent | a493fab7532c7410becd96079e7d749024271296 (diff) | |
complete the support for correct polling of 1ms 2ms 4ms 8ms
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/host/ehci/ehci.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index 8557ccd94..2f61afe78 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -524,13 +524,15 @@ void async_list_process_isr(ehci_qhd_t * const async_head) // TODO abstract max loop guard for async } -void period_list_process_isr(ehci_qhd_t const * const period_head) +void period_list_process_isr(uint8_t hostid, uint8_t interval_ms) { uint8_t max_loop = 0; - ehci_link_t next_item = period_head->next; + ehci_link_t next_item = * get_period_head(hostid, interval_ms); // TODO abstract max loop guard for period - while( !next_item.terminate && max_loop < (EHCI_MAX_QHD + EHCI_MAX_ITD + EHCI_MAX_SITD)) + while( !next_item.terminate && + !(interval_ms > 1 && align32(next_item.address) == get_period_head(hostid, 1)) && + max_loop < (EHCI_MAX_QHD + EHCI_MAX_ITD + EHCI_MAX_SITD)) { switch ( next_item.type ) { @@ -641,12 +643,15 @@ void hcd_isr(uint8_t hostid) //------------- some QTD/SITD/ITD with IOC set is completed -------------// if (int_status & EHCI_INT_MASK_NXP_ASYNC) { - async_list_process_isr(get_async_head(hostid)); + async_list_process_isr( get_async_head(hostid) ); } if (int_status & EHCI_INT_MASK_NXP_PERIODIC) { - period_list_process_isr( get_period_head(hostid, 1) ); + for (uint8_t i=1; i <= EHCI_FRAMELIST_SIZE; i *= 2) + { + period_list_process_isr( hostid, i ); + } } //------------- There is some removed async previously -------------// |
