diff options
| author | hathach <[email protected]> | 2013-09-19 16:11:11 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2013-09-19 16:11:11 +0700 |
| commit | 86681fe44226c636e62320f3cedcaddcd53259e9 (patch) | |
| tree | cd650952db469968d96bef1f4ea18207d3095b8c /tinyusb/host | |
| parent | 61c591b9ac49022fd287827951cd1f34d4fdbb1a (diff) | |
starting to add support for IAR workbench
Diffstat (limited to 'tinyusb/host')
| -rw-r--r-- | tinyusb/host/ehci/ehci.c | 20 | ||||
| -rw-r--r-- | tinyusb/host/usbh.c | 2 | ||||
| -rw-r--r-- | tinyusb/host/usbh.h | 6 |
3 files changed, 17 insertions, 11 deletions
diff --git a/tinyusb/host/ehci/ehci.c b/tinyusb/host/ehci/ehci.c index addf33adf..4bc69a51b 100644 --- a/tinyusb/host/ehci/ehci.c +++ b/tinyusb/host/ehci/ehci.c @@ -62,13 +62,19 @@ STATIC_ ehci_data_t ehci_data TUSB_CFG_ATTR_USBRAM; #if EHCI_PERIODIC_LIST #if (TUSB_CFG_CONTROLLER0_MODE & TUSB_MODE_HOST) - 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 + ATTR_ALIGNED(4096) STATIC_ ehci_link_t period_frame_list0[EHCI_FRAMELIST_SIZE] TUSB_CFG_ATTR_USBRAM; + + #ifndef __ICCARM__ // IAR cannot able to determine the alignment with dataalignment pragma + STATIC_ASSERT( ALIGN_OF(period_frame_list0) == 4096, "Period Framelist must be 4k alginment"); // validation + #endif #endif #if (TUSB_CFG_CONTROLLER1_MODE & TUSB_MODE_HOST) 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 + + #ifndef __ICCARM__ // IAR cannot able to determine the alignment with dataalignment pragma + STATIC_ASSERT( ALIGN_OF(period_frame_list1) == 4096, "Period Framelist must be 4k alginment"); // validation + #endif #endif #endif @@ -587,7 +593,7 @@ static void period_list_xfer_complete_isr(uint8_t hostid, uint8_t interval_ms) case EHCI_QUEUE_ELEMENT_SITD: case EHCI_QUEUE_ELEMENT_FSTN: default: - ASSERT (false, (void) 0); // TODO support hs/fs ISO + ASSERT (false, VOID_RETURN); // TODO support hs/fs ISO break; } @@ -667,7 +673,7 @@ static void xfer_error_isr(uint8_t hostid) case EHCI_QUEUE_ELEMENT_SITD: case EHCI_QUEUE_ELEMENT_FSTN: default: - ASSERT (false, (void) 0); // TODO support hs/fs ISO + ASSERT (false, VOID_RETURN); // TODO support hs/fs ISO break; } @@ -905,7 +911,7 @@ static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, uint16_t max_packet_si { if (TUSB_SPEED_HIGH == p_qhd->endpoint_speed) { - ASSERT_INT_WITHIN(1, 16, interval, (void) 0); + ASSERT_INT_WITHIN(1, 16, interval, VOID_RETURN); if ( interval < 4) // sub milisecond interval { p_qhd->interval_ms = 0; @@ -918,7 +924,7 @@ static void qhd_init(ehci_qhd_t *p_qhd, uint8_t dev_addr, uint16_t max_packet_si } }else { - ASSERT( 0 != interval, (void) 0); + ASSERT( 0 != interval, VOID_RETURN); // Full/Low: 4.12.2.1 (EHCI) case 1 schedule start split at 1 us & complete split at 2,3,4 uframes p_qhd->interrupt_smask = 0x01; p_qhd->non_hs_interrupt_cmask = BIN8(11100); diff --git a/tinyusb/host/usbh.c b/tinyusb/host/usbh.c index 99072bc7f..ce0c047d9 100644 --- a/tinyusb/host/usbh.c +++ b/tinyusb/host/usbh.c @@ -261,7 +261,7 @@ void usbh_xfer_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_event_t even usbh_class_drivers[class_index].isr(pipe_hdl, event, xferred_bytes); }else { - ASSERT(false, (void) 0); // something wrong, no one claims the isr's source + ASSERT(false, VOID_RETURN); // something wrong, no one claims the isr's source } } diff --git a/tinyusb/host/usbh.h b/tinyusb/host/usbh.h index e3300ff4c..aff39f33b 100644 --- a/tinyusb/host/usbh.h +++ b/tinyusb/host/usbh.h @@ -98,9 +98,9 @@ uint32_t tusbh_device_get_mounted_class_flag(uint8_t dev_addr); //--------------------------------------------------------------------+ // APPLICATION CALLBACK //--------------------------------------------------------------------+ -uint8_t tusbh_device_attached_cb (tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT; -void tusbh_device_mount_succeed_cb (uint8_t dev_addr) ATTR_WEAK; -void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK; // TODO refractor remove desc_device +ATTR_WEAK uint8_t tusbh_device_attached_cb (tusb_descriptor_device_t const *p_desc_device) ATTR_WARN_UNUSED_RESULT; +ATTR_WEAK void tusbh_device_mount_succeed_cb (uint8_t dev_addr); +ATTR_WEAK void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_device_t const *p_desc_device); // TODO refractor remove desc_device //--------------------------------------------------------------------+ // CLASS-USBH & INTERNAL API |
