diff options
| author | hathach <[email protected]> | 2013-03-24 21:53:41 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-03-24 21:53:41 +0700 |
| commit | 62f5ec8a0fd01529127f54da9efb8c8ed1fc8048 (patch) | |
| tree | b039aa245dfd419814a44b2771e3b30c3578a823 /tinyusb | |
| parent | c7c993d6cc497ff6baaa1e02d1c1da0dfa88017d (diff) | |
period_frame_list0 is not existed if period list is not required
Diffstat (limited to 'tinyusb')
| -rw-r--r-- | tinyusb/host/ehci/ehci.c | 20 |
1 files changed, 10 insertions, 10 deletions
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; |
