diff options
| author | hathach <[email protected]> | 2013-03-27 11:51:44 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-27 11:51:44 +0700 |
| commit | 7b5d9edc5af88422b26116a56032091e96714495 (patch) | |
| tree | 3062a01b7636ea43beb05a15ae9c736dd11edb04 /tests/test/support | |
| parent | b0ff7a7e235b1901def71305e6c35e6c3cda222c (diff) | |
add test for pipe_interrupt_xfer
implement keyboard app code
- forcefully place keyboard_report in RAM section 3
change used bit in qtd from reserved in buffer[1] to alternate link
add code for fake ehci controller runs on period interrupt
change signature of tusbh_hid_keyboard_get_report
- tusb_keyboard_report_t* to uint8_t*
implement period (interrupt) complete isr processing
Diffstat (limited to 'tests/test/support')
| -rw-r--r-- | tests/test/support/ehci_controller.c | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/tests/test/support/ehci_controller.c b/tests/test/support/ehci_controller.c index 80e3c3c44..31605cec0 100644 --- a/tests/test/support/ehci_controller.c +++ b/tests/test/support/ehci_controller.c @@ -55,12 +55,10 @@ LPC_USB1_Type lpc_usb1; //--------------------------------------------------------------------+ // IMPLEMENTATION //--------------------------------------------------------------------+ -void ehci_controller_run(uint8_t hostid) +bool complete_all_qtd_in_list(ehci_qhd_t *head) { - //------------- Async List -------------// - ehci_registers_t* const regs = get_operational_register(hostid); + ehci_qhd_t *p_qhd = head; - ehci_qhd_t *p_qhd = (ehci_qhd_t*) regs->async_list_base; do { if ( !p_qhd->qtd_overlay.halted ) @@ -72,11 +70,29 @@ void ehci_controller_run(uint8_t hostid) p_qhd->qtd_overlay = *p_qtd; } } - p_qhd = (ehci_qhd_t*) align32(p_qhd->next.address); - }while(p_qhd != get_async_head(hostid)); // stop if loop around + if (!p_qhd->next.terminate) + { + p_qhd = (ehci_qhd_t*) align32(p_qhd->next.address); + } + else + { + break; + } + }while(p_qhd != head); // stop if loop around + + return true; +} + +void ehci_controller_run(uint8_t hostid) +{ + //------------- Async List -------------// + ehci_registers_t* const regs = get_operational_register(hostid); + complete_all_qtd_in_list((ehci_qhd_t*) regs->async_list_base); + //------------- Period List -------------// + complete_all_qtd_in_list( get_period_head(hostid) ); + regs->usb_sts = EHCI_INT_MASK_NXP_ASYNC | EHCI_INT_MASK_NXP_PERIODIC; - regs->usb_sts = EHCI_INT_MASK_NXP_ASYNC; hcd_isr(hostid); } |
