enhance some tests

add test for usbh_isr error invoke
fix bug if device unplugged before is set to new address
- clean up & close control addr0 in usbh_device_unplugged_isr
This commit is contained in:
hathach
2013-03-23 17:31:51 +07:00
parent 4adfc6a6d8
commit 44e09cc397
12 changed files with 102 additions and 34 deletions

View File

@@ -77,6 +77,34 @@ void ehci_controller_run(uint8_t hostid)
//------------- Period List -------------//
regs->usb_sts = EHCI_INT_MASK_NXP_ASYNC;
hcd_isr(hostid);
}
void ehci_controller_run_error(uint8_t hostid)
{
//------------- Async List -------------//
ehci_registers_t* const regs = get_operational_register(hostid);
ehci_qhd_t *p_qhd = (ehci_qhd_t*) regs->async_list_base;
do
{
if ( !p_qhd->qtd_overlay.halted )
{
if(!p_qhd->qtd_overlay.next.terminate)
{
ehci_qtd_t* p_qtd = (ehci_qtd_t*) align32(p_qhd->qtd_overlay.next.address);
p_qtd->active = 0;
p_qtd->babble_err = p_qtd->buffer_err = p_qtd->xact_err = 1;
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
//------------- Period List -------------//
regs->usb_sts = EHCI_INT_MASK_ERROR;
hcd_isr(hostid);
}
void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed)