From aaf26a12e1f26d8ae69b1db0d483e7b16e9897c5 Mon Sep 17 00:00:00 2001 From: ccli8 Date: Wed, 24 May 2017 09:15:21 +0800 Subject: [PATCH] [M487] Fix compile error with GCC_ARM toolchain --- .../TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_hsusbd.c | 4 +++- .../TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_sdh.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_hsusbd.c b/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_hsusbd.c index 1a6920c2d7..22ea97a329 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_hsusbd.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_hsusbd.c @@ -41,8 +41,10 @@ static uint8_t g_hsusbd_TestSelector = 0ul; #ifdef __ICCARM__ #pragma data_alignment=4 static uint8_t g_hsusbd_buf[12]; -#else +#elif defined (__CC_ARM) __align(4) static uint8_t g_hsusbd_buf[12]; +#elif defined ( __GNUC__ ) +static uint8_t g_hsusbd_buf[12] __attribute__((aligned (4))); #endif uint8_t g_hsusbd_Configured = 0ul; diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_sdh.c b/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_sdh.c index 7d39cedfca..f09b782a1e 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_sdh.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/StdDriver/m480_sdh.c @@ -45,6 +45,8 @@ __align(4) uint8_t _SDH_ucSDHCBuffer[512]; #elif defined ( __ICCARM__ ) /*!< IAR Compiler */ #pragma data_alignment = 4 uint8_t _SDH_ucSDHCBuffer[512]; +#elif defined ( __GNUC__ ) +uint8_t _SDH_ucSDHCBuffer[512] __attribute__((aligned (4))); #endif int SDH_ok = 0;