summaryrefslogtreecommitdiff
path: root/tinyusb
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-21 19:23:19 +0700
committerhathach <[email protected]>2014-03-21 19:23:19 +0700
commit7c5b3861303e3cf0210a40bf8a0a511583700fd0 (patch)
treeec903bb701cb1dc43a81ea89834c13a14dd3626e /tinyusb
parentb349121c09c99dd65b35b785fa34d8884f6867f4 (diff)
clean ATTR_USB_MIN_ALIGNMENT on application and most of device except the msc_device.c
Diffstat (limited to 'tinyusb')
-rw-r--r--tinyusb/class/cdc_device.c2
-rw-r--r--tinyusb/class/hid_device.c4
-rw-r--r--tinyusb/class/msc_device.c2
-rw-r--r--tinyusb/device/dcd_lpc_11uxx_13uxx.c8
4 files changed, 10 insertions, 6 deletions
diff --git a/tinyusb/class/cdc_device.c b/tinyusb/class/cdc_device.c
index 332e33ea8..405095402 100644
--- a/tinyusb/class/cdc_device.c
+++ b/tinyusb/class/cdc_device.c
@@ -50,7 +50,7 @@
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
+TUSB_CFG_ATTR_USBRAM
static cdc_line_coding_t cdcd_line_coding[CONTROLLER_DEVICE_NUMBER];
typedef struct {
diff --git a/tinyusb/class/hid_device.c b/tinyusb/class/hid_device.c
index 1adf035b6..1f266da21 100644
--- a/tinyusb/class/hid_device.c
+++ b/tinyusb/class/hid_device.c
@@ -101,10 +101,8 @@ static hidd_class_driver_t const hidd_class_driver[HIDD_NUMBER_OF_SUBCLASS] =
#endif
};
-
// TODO [HID] generic
-TUSB_CFG_ATTR_USBRAM ATTR_USB_MIN_ALIGNMENT
-uint8_t m_control_data[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ];
+TUSB_CFG_ATTR_USBRAM uint8_t m_control_data[ MAX_OF(sizeof(hid_keyboard_report_t), sizeof(hid_mouse_report_t)) ];
//--------------------------------------------------------------------+
// KEYBOARD APPLICATION API
diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c
index d8f64f163..5f66e64b2 100644
--- a/tinyusb/class/msc_device.c
+++ b/tinyusb/class/msc_device.c
@@ -69,7 +69,7 @@ typedef struct {
endpoint_handle_t edpt_in, edpt_out;
}mscd_interface_t;
-ATTR_USB_MIN_ALIGNMENT TUSB_CFG_ATTR_USBRAM STATIC_VAR mscd_interface_t mscd_data;
+TUSB_CFG_ATTR_USBRAM STATIC_VAR mscd_interface_t mscd_data;
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
diff --git a/tinyusb/device/dcd_lpc_11uxx_13uxx.c b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
index 8ff68281b..1abe4912c 100644
--- a/tinyusb/device/dcd_lpc_11uxx_13uxx.c
+++ b/tinyusb/device/dcd_lpc_11uxx_13uxx.c
@@ -141,7 +141,13 @@ typedef struct {
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
//--------------------------------------------------------------------+
-TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) static dcd_11u_13u_data_t dcd_data;
+// TUSB_CFG_ATTR_USBRAM must have ATTR_ALIGNED(64) for lpc11u & lpc13u
+#ifdef __ICCARM__
+ATTR_ALIGNED(256) TUSB_CFG_ATTR_USBRAM // for IAR the first ATTR_ALIGNED takes effect
+#else
+TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(256) // GCC & Keil the last ATTR_ALIGNED takes effect
+#endif
+static dcd_11u_13u_data_t dcd_data;
static inline uint16_t addr_offset(void const * p_buffer) ATTR_CONST ATTR_ALWAYS_INLINE;
static inline uint16_t addr_offset(void const * p_buffer)