summaryrefslogtreecommitdiff
path: root/tests/test
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-01 19:32:53 +0700
committerhathach <[email protected]>2013-03-01 19:32:53 +0700
commit68ff7365c5083d693dd4aed9d29385b2fb3a71e2 (patch)
treedf1a335d671d75f7ea75acaa67eb79cd5e665daf /tests/test
parent795fe7468d35b62987cee07d35c7cf452447ea70 (diff)
rename ehci usb_int usb_sts usb/error field
move MCU define to tusb_option.h
Diffstat (limited to 'tests/test')
-rw-r--r--tests/test/host/ehci/test_ehci.c28
-rw-r--r--tests/test/support/tusb_config.h4
2 files changed, 28 insertions, 4 deletions
diff --git a/tests/test/host/ehci/test_ehci.c b/tests/test/host/ehci/test_ehci.c
index 2c6797109..d4a30a68f 100644
--- a/tests/test/host/ehci/test_ehci.c
+++ b/tests/test/host/ehci/test_ehci.c
@@ -46,6 +46,8 @@ extern ehci_data_t ehci_data;
extern ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE];
extern ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE];
+//LPC_USB0_Type lpc_usb0;
+//LPC_USB1_Type lpc_usb1;
//--------------------------------------------------------------------+
// Setup/Teardown + helper declare
//--------------------------------------------------------------------+
@@ -241,8 +243,8 @@ void test_register_usbcmd(void)
void test_register_usbsts(void)
{
- TEST_ASSERT_EQUAL( 0 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, int_usb));
- TEST_ASSERT_EQUAL( 1 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, int_error));
+ TEST_ASSERT_EQUAL( 0 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, usb));
+ TEST_ASSERT_EQUAL( 1 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, usb_error));
TEST_ASSERT_EQUAL( 2 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, port_change_detect));
TEST_ASSERT_EQUAL( 3 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, framelist_rollover));
TEST_ASSERT_EQUAL( 4 , BITFIELD_OFFSET_OF_MEMBER(ehci_registers_t, usb_sts_bit, host_system_error));
@@ -293,9 +295,12 @@ void test_ehci_data(void)
//
}
-void test_hcd_init(void)
+void test_hcd_init_data(void)
{
- hcd_init(0);
+ uint32_t random_data = 0x1234;
+ memcpy(&ehci_data, &random_data, sizeof(random_data));
+
+ hcd_init();
//------------- check memory data -------------//
ehci_data_t zeroes;
@@ -303,6 +308,21 @@ void test_hcd_init(void)
TEST_ASSERT_EQUAL_MEMORY(&zeroes, &ehci_data, sizeof(ehci_data_t));
}
+void test_hcd_init(void)
+{
+ hcd_init();
+
+ for(uint32_t i=0; i<TUSB_CFG_HOST_CONTROLLER_NUM; i++)
+ {
+ ehci_registers_t* regs = get_operational_register(i);
+
+ //------------- USB INT Enable-------------//
+// TEST_ASSERT(regs->usb_int_enable_bit.host_system_error);
+// TEST_ASSERT(regs->usb_int_enable_bit.usb);
+// TEST_ASSERT(regs->usb_int_enable_bit.usb_error);
+ }
+}
+
//--------------------------------------------------------------------+
// Helper
//--------------------------------------------------------------------+
diff --git a/tests/test/support/tusb_config.h b/tests/test/support/tusb_config.h
index e7c458661..625232acb 100644
--- a/tests/test/support/tusb_config.h
+++ b/tests/test/support/tusb_config.h
@@ -72,6 +72,10 @@
#define TUSB_CFG_HOST_HID_KEYBOARD 1
#define TUSB_CFG_HOST_HID_KEYBOARD_ENDPOINT_SIZE 64
+#define HOST_HCD_XFER_INTERRUPT
+#define HOST_HCD_XFER_BULK
+#define HOST_HCD_XFER_ISOCHRONOUS
+
//--------------------------------------------------------------------+
// DEVICE CONFIGURATION
//--------------------------------------------------------------------+