summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2013-03-24 21:53:41 +0700
committerhathach <[email protected]>2013-03-24 21:53:41 +0700
commit62f5ec8a0fd01529127f54da9efb8c8ed1fc8048 (patch)
treeb039aa245dfd419814a44b2771e3b30c3578a823
parentc7c993d6cc497ff6baaa1e02d1c1da0dfa88017d (diff)
period_frame_list0 is not existed if period list is not required
-rw-r--r--tests/test/support/tusb_config.h4
-rw-r--r--tinyusb/host/ehci/ehci.c20
2 files changed, 13 insertions, 11 deletions
diff --git a/tests/test/support/tusb_config.h b/tests/test/support/tusb_config.h
index de583e98c..ad3de6851 100644
--- a/tests/test/support/tusb_config.h
+++ b/tests/test/support/tusb_config.h
@@ -69,13 +69,15 @@
#define TUSB_CFG_CONFIGURATION_MAX 2
#define TUSB_CFG_HOST_ENUM_BUFFER_SIZE 256
+
//------------- CLASS -------------//
#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
+//#define HOST_HCD_XFER_ISOCHRONOUS
// Test support
#define TEST_CONTROLLER_HOST_START_INDEX ( ((CONTROLLER_HOST_NUMBER == 1) && (TUSB_CFG_CONTROLLER1_MODE & TUSB_MODE_HOST)) ? 1 : 0)
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c
index 78db3bc40..558b6a5b1 100644
--- a/tinyusb/host/ehci/ehci.c
+++ b/tinyusb/host/ehci/ehci.c
@@ -57,17 +57,18 @@
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
STATIC_ ehci_data_t ehci_data TUSB_CFG_ATTR_USBRAM;
-//TODO removed if not use period list
-STATIC_ ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
-#if CONTROLLER_HOST_NUMBER > 1
-STATIC_ ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
+
+#if EHCI_PERIODIC_LIST
+ STATIC_ ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
+ STATIC_ASSERT( ALIGN_OF(period_frame_list0) == 4096, "Period Framelist must be 4k alginment"); // validation
+
+ #if CONTROLLER_HOST_NUMBER > 1
+ STATIC_ ehci_link_t period_frame_list1[EHCI_FRAMELIST_SIZE] ATTR_ALIGNED(4096) TUSB_CFG_ATTR_USBRAM;
+ STATIC_ASSERT( ALIGN_OF(period_frame_list1) == 4096, "Period Framelist must be 4k alginment"); // validation
+ #endif
#endif
//------------- Validation -------------//
-STATIC_ASSERT( ALIGN_OF(period_frame_list0) == 4096, "Period Framelist must be 4k alginment");
-#if CONTROLLER_HOST_NUMBER > 1
-STATIC_ASSERT( ALIGN_OF(period_frame_list1) == 4096, "Period Framelist must be 4k alginment");
-#endif
// TODO static assert for memory placement on some known MCU such as lpc43xx
//--------------------------------------------------------------------+
@@ -344,8 +345,7 @@ static tusb_error_t hcd_controller_init(uint8_t hostid)
ehci_link_t * const framelist = get_period_frame_list(hostid);
ehci_qhd_t * const period_head = get_period_head(hostid);
- uint32_t i;
- for(i=0; i<EHCI_FRAMELIST_SIZE; i++)
+ for(uint32_t i=0; i<EHCI_FRAMELIST_SIZE; i++)
{
framelist[i].address = (uint32_t) period_head;
framelist[i].type = EHCI_QUEUE_ELEMENT_QHD;