mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-28 16:20:26 +00:00
refractor test
This commit is contained in:
parent
68dddefe7b
commit
bc9a97a1be
@ -93,11 +93,10 @@ void test_isr_device_connect_slowspeed(void)
|
|||||||
|
|
||||||
void test_isr_device_disconnect(void)
|
void test_isr_device_disconnect(void)
|
||||||
{
|
{
|
||||||
ehci_controller_device_unplug(hostid);
|
|
||||||
usbh_device_unplugged_isr_Expect(hostid);
|
usbh_device_unplugged_isr_Expect(hostid);
|
||||||
|
|
||||||
//------------- Code Under Test -------------//
|
//------------- Code Under Test -------------//
|
||||||
hcd_isr(hostid);
|
ehci_controller_device_unplug(hostid);
|
||||||
|
|
||||||
TEST_ASSERT(regs->usb_cmd_bit.advacne_async);
|
TEST_ASSERT(regs->usb_cmd_bit.advacne_async);
|
||||||
}
|
}
|
||||||
|
@ -155,10 +155,10 @@ void ehci_controller_device_plug(uint8_t hostid, tusb_speed_t speed)
|
|||||||
{
|
{
|
||||||
ehci_registers_t* const regs = get_operational_register(hostid);
|
ehci_registers_t* const regs = get_operational_register(hostid);
|
||||||
|
|
||||||
regs->usb_sts_bit.port_change_detect = 1;
|
regs->usb_sts_bit.port_change_detect = 1;
|
||||||
regs->portsc_bit.connect_status_change = 1;
|
regs->portsc_bit.connect_status_change = 1;
|
||||||
regs->portsc_bit.current_connect_status = 1;
|
regs->portsc_bit.current_connect_status = 1;
|
||||||
regs->portsc_bit.nxp_port_speed = speed;
|
regs->portsc_bit.nxp_port_speed = speed;
|
||||||
|
|
||||||
hcd_isr(hostid);
|
hcd_isr(hostid);
|
||||||
}
|
}
|
||||||
@ -167,7 +167,9 @@ void ehci_controller_device_unplug(uint8_t hostid)
|
|||||||
{
|
{
|
||||||
ehci_registers_t* const regs = get_operational_register(hostid);
|
ehci_registers_t* const regs = get_operational_register(hostid);
|
||||||
|
|
||||||
regs->usb_sts_bit.port_change_detect = 1;
|
regs->usb_sts_bit.port_change_detect = 1;
|
||||||
regs->portsc_bit.connect_status_change = 1;
|
regs->portsc_bit.connect_status_change = 1;
|
||||||
regs->portsc_bit.current_connect_status = 0;
|
regs->portsc_bit.current_connect_status = 0;
|
||||||
|
|
||||||
|
hcd_isr(hostid);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user