Skip to content

Commit 6795325

Browse files
committed
Use official toolchain defines
1 parent 9865744 commit 6795325

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

targets/TARGET_STM/TARGET_STM32L4/l4_retarget.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
*
3333
******************************************************************************
3434
*/
35-
#if defined(TWO_RAM_REGIONS)
36-
#if defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR)
37-
35+
#if (defined(TWO_RAM_REGIONS) && defined(__GNUC__) && !defined(__CC_ARM))
3836
#include <errno.h>
3937
#include "stm32l4xx.h"
4038
extern uint32_t __mbed_sbrk_start;
@@ -64,5 +62,5 @@ void *__wrap__sbrk(int incr)
6462

6563
return (void *) heap_ind_old;
6664
}
67-
#endif /* GCC_ARM toolchain */
68-
#endif /* TWO_RAM_REGIONS */
65+
#endif /* GCC_ARM toolchain && TWO_RAM_REGIONS*/
66+

targets/TARGET_STM/mbed_rtx.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
#ifndef INITIAL_SP
2121

2222
#if (defined(TARGET_STM32L475VG))
23-
/* only GCC_ARM and IAR toolchain have the stack on SRAM2 */
24-
#if (defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR) || defined(__IAR_SYSTEMS_ICC__ ))
23+
/* only GCC_ARM and IAR toolchains have the stack on SRAM2 */
24+
#if (((defined(__GNUC__) && !defined(__CC_ARM)) ||\
25+
defined(__IAR_SYSTEMS_ICC__ )) &&\
26+
defined(TWO_RAM_REGIONS))
2527
#define INITIAL_SP (0x10008000UL)
2628
#else
2729
#define INITIAL_SP (0x20018000UL)
@@ -117,7 +119,7 @@
117119
#endif
118120

119121
#endif // INITIAL_SP
120-
#if defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR)
122+
#if (defined(__GNUC__) && !defined(__CC_ARM))
121123
extern uint32_t __StackLimit[];
122124
extern uint32_t __StackTop[];
123125
extern uint32_t __end__[];
@@ -126,8 +128,6 @@
126128
#define HEAP_SIZE ((uint32_t)((uint32_t)__HeapLimit - (uint32_t)HEAP_START))
127129
#define ISR_STACK_START ((unsigned char*)__StackLimit)
128130
#define ISR_STACK_SIZE ((uint32_t)((uint32_t)__StackTop - (uint32_t)__StackLimit))
129-
#elif defined(__ICCARM__)
130-
/* No region declarations needed */
131131
#endif
132132

133133
#endif // MBED_MBED_RTX_H

0 commit comments

Comments
 (0)