diff options
| author | hathach <[email protected]> | 2019-06-06 10:39:37 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2019-06-06 10:39:37 +0700 |
| commit | 13e01c7dca1e72097be1723676b086be29d0e622 (patch) | |
| tree | 699e883134aae84d54fe592346b2bb4eb92acb7c /src/host | |
| parent | 90fea785c6aa60fdfd398fee262bb06c69a010b7 (diff) | |
add TU_ prefix to compiler ATTR to prevent name conflict with application
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/ehci/ehci.c | 2 | ||||
| -rw-r--r-- | src/host/ehci/ehci.h | 10 | ||||
| -rw-r--r-- | src/host/hub.c | 2 | ||||
| -rw-r--r-- | src/host/hub.h | 6 | ||||
| -rw-r--r-- | src/host/ohci/ohci.c | 2 | ||||
| -rw-r--r-- | src/host/ohci/ohci.h | 10 | ||||
| -rw-r--r-- | src/host/usbh.c | 2 | ||||
| -rw-r--r-- | src/host/usbh.h | 6 |
8 files changed, 20 insertions, 20 deletions
diff --git a/src/host/ehci/ehci.c b/src/host/ehci/ehci.c index 2973c6895..63e87dd54 100644 --- a/src/host/ehci/ehci.c +++ b/src/host/ehci/ehci.c @@ -44,7 +44,7 @@ // INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
// Periodic frame list must be 4K alignment
-CFG_TUSB_MEM_SECTION ATTR_ALIGNED(4096) static ehci_data_t ehci_data;
+CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4096) static ehci_data_t ehci_data;
// EHCI portable
uint32_t hcd_ehci_register_addr(uint8_t rhport);
diff --git a/src/host/ehci/ehci.h b/src/host/ehci/ehci.h index f64c58a0c..ce2f56771 100644 --- a/src/host/ehci/ehci.h +++ b/src/host/ehci/ehci.h @@ -95,7 +95,7 @@ typedef union { }ehci_link_t; /// Queue Element Transfer Descriptor -/// Qtd is used to declare overlay in ehci_qhd_t -> cannot be declared with ATTR_ALIGNED(32) +/// Qtd is used to declare overlay in ehci_qhd_t -> cannot be declared with TU_ATTR_ALIGNED(32) typedef struct { // Word 0: Next QTD Pointer @@ -137,7 +137,7 @@ typedef struct TU_VERIFY_STATIC( sizeof(ehci_qtd_t) == 32, "size is not correct" ); /// Queue Head -typedef struct ATTR_ALIGNED(32) +typedef struct TU_ATTR_ALIGNED(32) { // Word 0: Next QHD ehci_link_t next; @@ -185,7 +185,7 @@ typedef struct ATTR_ALIGNED(32) TU_VERIFY_STATIC( sizeof(ehci_qhd_t) == 64, "size is not correct" ); /// Highspeed Isochronous Transfer Descriptor (section 3.3) -typedef struct ATTR_ALIGNED(32) { +typedef struct TU_ATTR_ALIGNED(32) { // Word 0: Next Link Pointer ehci_link_t next; @@ -217,7 +217,7 @@ typedef struct ATTR_ALIGNED(32) { TU_VERIFY_STATIC( sizeof(ehci_itd_t) == 64, "size is not correct" ); /// Split (Full-Speed) Isochronous Transfer Descriptor -typedef struct ATTR_ALIGNED(32) +typedef struct TU_ATTR_ALIGNED(32) { // Word 0: Next Link Pointer ehci_link_t next; @@ -442,7 +442,7 @@ typedef struct }control[CFG_TUSB_HOST_DEVICE_MAX+1]; ehci_qhd_t qhd_pool[HCD_MAX_ENDPOINT]; - ehci_qtd_t qtd_pool[HCD_MAX_XFER] ATTR_ALIGNED(32); + ehci_qtd_t qtd_pool[HCD_MAX_XFER] TU_ATTR_ALIGNED(32); ehci_registers_t* regs; }ehci_data_t; diff --git a/src/host/hub.c b/src/host/hub.c index cc440086f..a2d4e8429 100644 --- a/src/host/hub.c +++ b/src/host/hub.c @@ -45,7 +45,7 @@ typedef struct }usbh_hub_t;
CFG_TUSB_MEM_SECTION static usbh_hub_t hub_data[CFG_TUSB_HOST_DEVICE_MAX];
-ATTR_ALIGNED(4) CFG_TUSB_MEM_SECTION static uint8_t hub_enum_buffer[sizeof(descriptor_hub_desc_t)];
+TU_ATTR_ALIGNED(4) CFG_TUSB_MEM_SECTION static uint8_t hub_enum_buffer[sizeof(descriptor_hub_desc_t)];
//OSAL_SEM_DEF(hub_enum_semaphore);
//static osal_semaphore_handle_t hub_enum_sem_hdl;
diff --git a/src/host/hub.h b/src/host/hub.h index 0182337b1..51d33d4e5 100644 --- a/src/host/hub.h +++ b/src/host/hub.h @@ -81,7 +81,7 @@ //indicators. See Section 11.5.3.
//D15...D8: Reserved
-typedef struct ATTR_PACKED{
+typedef struct TU_ATTR_PACKED{
uint8_t bLength ; ///< Size of descriptor
uint8_t bDescriptorType ; ///< Other_speed_Configuration Type
uint8_t bNbrPorts;
@@ -135,7 +135,7 @@ enum{ // data in response of HUB_REQUEST_GET_STATUS, wIndex = 0 (hub)
typedef struct {
union{
- struct ATTR_PACKED {
+ struct TU_ATTR_PACKED {
uint16_t local_power_source : 1;
uint16_t over_current : 1;
uint16_t : 14;
@@ -150,7 +150,7 @@ TU_VERIFY_STATIC( sizeof(hub_status_response_t) == 4, "size is not correct"); // data in response of HUB_REQUEST_GET_STATUS, wIndex = Port num
typedef struct {
union {
- struct ATTR_PACKED {
+ struct TU_ATTR_PACKED {
uint16_t connect_status : 1;
uint16_t port_enable : 1;
uint16_t suspend : 1;
diff --git a/src/host/ohci/ohci.c b/src/host/ohci/ohci.c index e22f04f9b..ea553baa2 100644 --- a/src/host/ohci/ohci.c +++ b/src/host/ohci/ohci.c @@ -124,7 +124,7 @@ enum { //--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-CFG_TUSB_MEM_SECTION ATTR_ALIGNED(256) static ohci_data_t ohci_data;
+CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(256) static ohci_data_t ohci_data;
static ohci_ed_t * const p_ed_head[] =
{
diff --git a/src/host/ohci/ohci.h b/src/host/ohci/ohci.h index ec35edf19..a8aae251b 100644 --- a/src/host/ohci/ohci.h +++ b/src/host/ohci/ohci.h @@ -65,7 +65,7 @@ typedef struct { volatile uint16_t frame_pad;
volatile uint32_t done_head;
uint8_t reserved[116+4]; // TODO try to make use of this area if possible, extra 4 byte to make the whole struct size = 256
-}ohci_hcca_t; // ATTR_ALIGNED(256)
+}ohci_hcca_t; // TU_ATTR_ALIGNED(256)
TU_VERIFY_STATIC( sizeof(ohci_hcca_t) == 256, "size is not correct" );
@@ -76,7 +76,7 @@ typedef struct { }ohci_td_item_t;
-typedef struct ATTR_ALIGNED(16)
+typedef struct TU_ATTR_ALIGNED(16)
{
// Word 0
uint32_t used : 1;
@@ -102,7 +102,7 @@ typedef struct ATTR_ALIGNED(16) TU_VERIFY_STATIC( sizeof(ohci_gtd_t) == 16, "size is not correct" );
-typedef struct ATTR_ALIGNED(16)
+typedef struct TU_ATTR_ALIGNED(16)
{
// Word 0
uint32_t dev_addr : 7;
@@ -137,7 +137,7 @@ typedef struct ATTR_ALIGNED(16) TU_VERIFY_STATIC( sizeof(ohci_ed_t) == 16, "size is not correct" );
-typedef struct ATTR_ALIGNED(32)
+typedef struct TU_ATTR_ALIGNED(32)
{
/*---------- Word 1 ----------*/
uint32_t starting_frame : 16;
@@ -163,7 +163,7 @@ typedef struct ATTR_ALIGNED(32) TU_VERIFY_STATIC( sizeof(ochi_itd_t) == 32, "size is not correct" );
// structure with member alignment required from large to small
-typedef struct ATTR_ALIGNED(256)
+typedef struct TU_ATTR_ALIGNED(256)
{
ohci_hcca_t hcca;
diff --git a/src/host/usbh.c b/src/host/usbh.c index f370b62f4..655e3dd4b 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -109,7 +109,7 @@ CFG_TUSB_MEM_SECTION usbh_device_t _usbh_devices[CFG_TUSB_HOST_DEVICE_MAX+1]; OSAL_QUEUE_DEF(OPT_MODE_HOST, _usbh_qdef, CFG_TUH_TASK_QUEUE_SZ, hcd_event_t);
static osal_queue_t _usbh_q;
-CFG_TUSB_MEM_SECTION ATTR_ALIGNED(4) static uint8_t _usbh_ctrl_buf[CFG_TUSB_HOST_ENUM_BUFFER_SIZE];
+CFG_TUSB_MEM_SECTION TU_ATTR_ALIGNED(4) static uint8_t _usbh_ctrl_buf[CFG_TUSB_HOST_ENUM_BUFFER_SIZE];
//------------- Reporter Task Data -------------//
diff --git a/src/host/usbh.h b/src/host/usbh.h index a0955e9f9..311b2514d 100644 --- a/src/host/usbh.h +++ b/src/host/usbh.h @@ -77,13 +77,13 @@ static inline bool tuh_device_is_configured(uint8_t dev_addr) //--------------------------------------------------------------------+ // APPLICATION CALLBACK //--------------------------------------------------------------------+ -ATTR_WEAK uint8_t tuh_device_attached_cb (tusb_desc_device_t const *p_desc_device); +TU_ATTR_WEAK uint8_t tuh_device_attached_cb (tusb_desc_device_t const *p_desc_device); /** Callback invoked when device is mounted (configured) */ -ATTR_WEAK void tuh_mount_cb (uint8_t dev_addr); +TU_ATTR_WEAK void tuh_mount_cb (uint8_t dev_addr); /** Callback invoked when device is unmounted (bus reset/unplugged) */ -ATTR_WEAK void tuh_umount_cb(uint8_t dev_addr); +TU_ATTR_WEAK void tuh_umount_cb(uint8_t dev_addr); //--------------------------------------------------------------------+ // CLASS-USBH & INTERNAL API |
