From 67953251f963afefc3595c25003545d1880f8711 Mon Sep 17 00:00:00 2001 From: adustm Date: Fri, 23 Feb 2018 10:29:29 +0100 Subject: [PATCH] Use official toolchain defines --- targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c | 8 +++----- targets/TARGET_STM/mbed_rtx.h | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c b/targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c index b56322b70f..dbb446aa7a 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c +++ b/targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c @@ -32,9 +32,7 @@ * ****************************************************************************** */ -#if defined(TWO_RAM_REGIONS) -#if defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR) - +#if (defined(TWO_RAM_REGIONS) && defined(__GNUC__) && !defined(__CC_ARM)) #include #include "stm32l4xx.h" extern uint32_t __mbed_sbrk_start; @@ -64,5 +62,5 @@ void *__wrap__sbrk(int incr) return (void *) heap_ind_old; } -#endif /* GCC_ARM toolchain */ -#endif /* TWO_RAM_REGIONS */ +#endif /* GCC_ARM toolchain && TWO_RAM_REGIONS*/ + diff --git a/targets/TARGET_STM/mbed_rtx.h b/targets/TARGET_STM/mbed_rtx.h index f81af15724..d3bf003e53 100644 --- a/targets/TARGET_STM/mbed_rtx.h +++ b/targets/TARGET_STM/mbed_rtx.h @@ -20,8 +20,10 @@ #ifndef INITIAL_SP #if (defined(TARGET_STM32L475VG)) -/* only GCC_ARM and IAR toolchain have the stack on SRAM2 */ -#if (defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR) || defined(__IAR_SYSTEMS_ICC__ )) +/* only GCC_ARM and IAR toolchains have the stack on SRAM2 */ +#if (((defined(__GNUC__) && !defined(__CC_ARM)) ||\ + defined(__IAR_SYSTEMS_ICC__ )) &&\ + defined(TWO_RAM_REGIONS)) #define INITIAL_SP (0x10008000UL) #else #define INITIAL_SP (0x20018000UL) @@ -117,7 +119,7 @@ #endif #endif // INITIAL_SP -#if defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR) +#if (defined(__GNUC__) && !defined(__CC_ARM)) extern uint32_t __StackLimit[]; extern uint32_t __StackTop[]; extern uint32_t __end__[]; @@ -126,8 +128,6 @@ #define HEAP_SIZE ((uint32_t)((uint32_t)__HeapLimit - (uint32_t)HEAP_START)) #define ISR_STACK_START ((unsigned char*)__StackLimit) #define ISR_STACK_SIZE ((uint32_t)((uint32_t)__StackTop - (uint32_t)__StackLimit)) -#elif defined(__ICCARM__) - /* No region declarations needed */ #endif #endif // MBED_MBED_RTX_H