From 91afbce18ac5c11be81eae9226c1ec8f1403a5b1 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 30 Aug 2017 09:06:04 -0500 Subject: [PATCH] Correct Nuvoton compiler detection logic --- targets/TARGET_NUVOTON/TARGET_M451/device/cmsis.h | 2 +- .../TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h | 2 +- .../TARGET_M451/device/startup_M451Series.c | 8 ++++---- targets/TARGET_NUVOTON/TARGET_M480/device/cmsis.h | 2 +- .../TARGET_NUVOTON/TARGET_M480/device/cmsis_nvic.h | 2 +- .../TARGET_NUVOTON/TARGET_M480/device/startup_M480.c | 12 ++++++------ targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h | 2 +- .../TARGET_NANO100/device/cmsis_nvic.h | 2 +- .../TARGET_NANO100/device/startup_Nano100Series.c | 8 ++++---- targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h | 2 +- .../TARGET_NUVOTON/TARGET_NUC472/device/cmsis_nvic.h | 2 +- .../TARGET_NUC472/device/startup_NUC472_442.c | 8 ++++---- targets/TARGET_NUVOTON/mbed_rtx.h | 2 +- 13 files changed, 27 insertions(+), 27 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis.h b/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis.h index c183fd04cd..dd9d4efc23 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis.h +++ b/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis.h @@ -21,7 +21,7 @@ #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h b/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h index 5fe2a7d143..92712dbf79 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h +++ b/targets/TARGET_NUVOTON/TARGET_M451/device/cmsis_nvic.h @@ -19,7 +19,7 @@ #define NVIC_NUM_VECTORS (16 + 64) -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) # define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IRAMVEC$$ZI$$Base) #elif defined(__ICCARM__) # pragma section = "IRAMVEC" diff --git a/targets/TARGET_NUVOTON/TARGET_M451/device/startup_M451Series.c b/targets/TARGET_NUVOTON/TARGET_M451/device/startup_M451Series.c index a7852ec676..22fc4818b6 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/device/startup_M451Series.c +++ b/targets/TARGET_NUVOTON/TARGET_M451/device/startup_M451Series.c @@ -47,7 +47,7 @@ void FUN(void) __attribute__ ((weak, alias(#FUN_ALIAS))); /* Initialize segments */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit; extern void __main(void); #elif defined(__ICCARM__) @@ -152,7 +152,7 @@ WEAK_ALIAS_FUNC(SC0_IRQHandler, Default_Handler) // 58: WEAK_ALIAS_FUNC(TK_IRQHandler, Default_Handler) // 63: /* Vector table */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __attribute__ ((section("RESET"))) const uint32_t __vector_handlers[] = { #elif defined(__ICCARM__) @@ -164,7 +164,7 @@ const uint32_t __vector_handlers[] = { #endif /* Configure Initial Stack Pointer, using linker-generated symbols */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) (uint32_t) &Image$$ARM_LIB_STACK$$ZI$$Limit, #elif defined(__ICCARM__) //(uint32_t) __sfe("CSTACK"), @@ -279,7 +279,7 @@ void Reset_Handler(void) /* Enable register write-protection function */ SYS_LockReg(); -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __main(); #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis.h b/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis.h index a5e5ef63c7..ed737ab6d3 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis.h +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis.h @@ -21,7 +21,7 @@ #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis_nvic.h b/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis_nvic.h index adcbd1153b..ea73d8cb2d 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis_nvic.h +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/cmsis_nvic.h @@ -23,7 +23,7 @@ #define NVIC_USER_IRQ_NUMBER 96 #define NVIC_NUM_VECTORS (NVIC_USER_IRQ_OFFSET + NVIC_USER_IRQ_NUMBER) -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) # define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IRAMVEC$$ZI$$Base) #elif defined(__ICCARM__) # pragma section = "IRAMVEC" diff --git a/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c b/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c index d6a7a54b92..53e97a82c1 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/device/startup_M480.c @@ -50,7 +50,7 @@ void FUN(void) __attribute__ ((weak, alias(#FUN_ALIAS))); /* Initialize segments */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit; extern void __main(void); #elif defined(__ICCARM__) @@ -190,7 +190,7 @@ WEAK_ALIAS_FUNC(SWDC_IRQHandler, Default_Handler) // 94: WEAK_ALIAS_FUNC(ETMC_IRQHandler, Default_Handler) // 95: /* Vector table */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __attribute__ ((section("RESET"))) const uint32_t __vector_handlers[] = { #elif defined(__ICCARM__) @@ -201,7 +201,7 @@ __attribute__ ((section(".vector_table"))) const uint32_t __vector_handlers[] = { #endif -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) (uint32_t) &Image$$ARM_LIB_STACK$$ZI$$Limit, #elif defined(__ICCARM__) (uint32_t) &CSTACK$$Limit, @@ -339,7 +339,7 @@ const uint32_t __vector_handlers[] = { * C/C++ runtime initialization */ -#if defined (__CC_ARM) +#if defined(__CC_ARM) __asm static void Reset_Handler(void) { @@ -406,7 +406,7 @@ void Reset_Handler_1(void) /* Enable register write-protection function */ SYS_LockReg(); -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) Reset_Handler_Cascade((void *) &Image$$ARM_LIB_STACK$$ZI$$Limit, (void *) Reset_Handler_2); #elif defined(__ICCARM__) Reset_Handler_Cascade((void *) &CSTACK$$Limit, (void *) Reset_Handler_2); @@ -429,7 +429,7 @@ void Reset_Handler_2(void) uvisor_init(); #endif -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __main(); #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h b/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h index e1ead52d67..9d23802c14 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis.h @@ -21,7 +21,7 @@ #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.h b/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.h index 29c862b79b..ac0e7c9a4e 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.h +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/device/cmsis_nvic.h @@ -23,7 +23,7 @@ #define NVIC_USER_IRQ_NUMBER 32 #define NVIC_NUM_VECTORS (NVIC_USER_IRQ_OFFSET + NVIC_USER_IRQ_NUMBER) -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) # define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IRAMVEC$$ZI$$Base) #elif defined(__ICCARM__) # pragma section = "IRAMVEC" diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/device/startup_Nano100Series.c b/targets/TARGET_NUVOTON/TARGET_NANO100/device/startup_Nano100Series.c index 46fa925910..7f44959289 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/device/startup_Nano100Series.c +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/device/startup_Nano100Series.c @@ -45,7 +45,7 @@ void FUN(void) __attribute__ ((weak, alias(#FUN_ALIAS))); /* Initialize segments */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit; extern void __main(void); #elif defined(__ICCARM__) @@ -114,7 +114,7 @@ WEAK_ALIAS_FUNC(DAC_IRQHandler, Default_Handler) // DAC interrupt WEAK_ALIAS_FUNC(RTC_IRQHandler, Default_Handler) // Real time clock interrupt /* Vector table */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __attribute__ ((section("RESET"))) const uint32_t __vector_handlers[] = { #elif defined(__ICCARM__) @@ -126,7 +126,7 @@ const uint32_t __vector_handlers[] = { #endif /* Configure Initial Stack Pointer, using linker-generated symbols */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) (uint32_t) &Image$$ARM_LIB_STACK$$ZI$$Limit, #elif defined(__ICCARM__) (uint32_t) &CSTACK$$Limit, @@ -199,7 +199,7 @@ void Reset_Handler(void) /* Enable register write-protection function */ SYS_LockReg(); -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __main(); #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h b/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h index 2256eb6d55..3ec85e4084 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h @@ -22,7 +22,7 @@ // Support linker-generated symbol as start of relocated vector table. -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis_nvic.h b/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis_nvic.h index 1c402d84c6..6a492639ac 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis_nvic.h +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/device/cmsis_nvic.h @@ -19,7 +19,7 @@ #define NVIC_NUM_VECTORS (16 + 142) -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) # define NVIC_RAM_VECTOR_ADDRESS ((uint32_t) &Image$$ER_IRAMVEC$$ZI$$Base) #elif defined(__ICCARM__) # pragma section = "IRAMVEC" diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/device/startup_NUC472_442.c b/targets/TARGET_NUVOTON/TARGET_NUC472/device/startup_NUC472_442.c index a73f8f2ecb..77282026c3 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/device/startup_NUC472_442.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/device/startup_NUC472_442.c @@ -47,7 +47,7 @@ void FUN(void) __attribute__ ((weak, alias(#FUN_ALIAS))); /* Initialize segments */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Limit; extern void __main(void); #elif defined(__ICCARM__) @@ -232,7 +232,7 @@ WEAK_ALIAS_FUNC(CRYPTO_IRQHandler, Default_Handler) // 140: CRYPTO WEAK_ALIAS_FUNC(CRC_IRQHandler, Default_Handler) // 141: CRC /* Vector table */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __attribute__ ((section("RESET"))) const uint32_t __vector_handlers[] = { #elif defined(__ICCARM__) @@ -244,7 +244,7 @@ const uint32_t __vector_handlers[] = { #endif /* Configure Initial Stack Pointer, using linker-generated symbols */ -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) (uint32_t) &Image$$ARM_LIB_STACK$$ZI$$Limit, #elif defined(__ICCARM__) //(uint32_t) __sfe("CSTACK"), @@ -439,7 +439,7 @@ void Reset_Handler(void) /* Enable register write-protection function */ SYS_LockReg(); -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) __main(); #elif defined(__ICCARM__) diff --git a/targets/TARGET_NUVOTON/mbed_rtx.h b/targets/TARGET_NUVOTON/mbed_rtx.h index d6ab7eec90..6983b2e78b 100644 --- a/targets/TARGET_NUVOTON/mbed_rtx.h +++ b/targets/TARGET_NUVOTON/mbed_rtx.h @@ -21,7 +21,7 @@ #if defined(TARGET_NUVOTON) -#if defined(__CC_ARM) +#if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Base[]; extern uint32_t Image$$ARM_LIB_HEAP$$ZI$$Length[]; extern uint32_t Image$$ARM_LIB_STACK$$ZI$$Base[];