summaryrefslogtreecommitdiff
path: root/tinyusb/class/msc_device.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2014-03-12 14:28:43 +0700
committerhathach <[email protected]>2014-03-12 14:28:43 +0700
commitb6e4c0d34897a574b2f49074bb57dc91584da77c (patch)
tree60dd49b309af2195cb978b1085e7eefb88562eb2 /tinyusb/class/msc_device.c
parent9ba209cda074289bbbe51dc79b4231404c8089ba (diff)
a fix to IAR's incapability to force struct's member on specified alignment
Diffstat (limited to 'tinyusb/class/msc_device.c')
-rw-r--r--tinyusb/class/msc_device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tinyusb/class/msc_device.c b/tinyusb/class/msc_device.c
index 2196a0164..77ce2edc8 100644
--- a/tinyusb/class/msc_device.c
+++ b/tinyusb/class/msc_device.c
@@ -53,7 +53,17 @@
//--------------------------------------------------------------------+
typedef struct {
ATTR_USB_MIN_ALIGNMENT msc_cmd_block_wrapper_t cbw;
+
+#if defined (__ICCARM__) && (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX)
+ uint8_t padding1[64-sizeof(msc_cmd_block_wrapper_t)]; // IAR cannot align struct's member
+#endif
+
ATTR_USB_MIN_ALIGNMENT msc_cmd_status_wrapper_t csw;
+
+#if defined (__ICCARM__) && (TUSB_CFG_MCU == MCU_LPC11UXX || TUSB_CFG_MCU == MCU_LPC13UXX)
+ uint8_t padding2[64-sizeof(msc_cmd_status_wrapper_t)]; // IAR cannot align struct's member
+#endif
+
ATTR_USB_MIN_ALIGNMENT uint8_t max_lun; // can STALL for one LUN
uint8_t interface_number;