Document API IEC60730 Library
sl_iec60730_toolchain.h
Go to the documentation of this file.
1 /***************************************************************************/
18 #ifndef SL_IEC60730_TOOLCHAIN_H
19 #define SL_IEC60730_TOOLCHAIN_H
20 
21 /**************************************************************************/
49 #ifndef NULL
51 #define NULL ((void *) 0)
52 #endif
53 
54 // -------------------------------
55 // GCC for ARM Cortex-M
56 //
57 #if defined(__GNUC__)
58 
62 #define NOP() __NOP()
63 
65 #define IEC60730_VAR_NO_INIT __attribute__((section(".noinit")))
66 #define IEC60730_DATA_NO_CLEAR __attribute__((section(".ram_no_clear")))
68 
71 #ifndef __STACK_BOTTOM
72 #define __STACK_BOTTOM __attribute__((section(".stack_bottom")))
73 #endif /* __STACK_BOTTOM */
74 
77 #ifndef __CLASSB_RAM
78 #define __CLASSB_RAM __attribute__((section(".classb_ram")))
79 #endif /* __CLASSB_RAM */
80 
83 #ifndef __RT_BUF
84 #define __RT_BUF __attribute__((section(".rt_buf")))
85 #endif /* __RT_BUF */
86 
89 #ifndef __OVERLAP
90 #define __OVERLAP __attribute__((section(".overlap")))
91 #endif /* __OVERLAP */
92 
94 #define LB_ASM __asm__
95 #define LB_XSTR(x) XSTR(x:)
97 
98 // -------------------------------
99 // IAR for ARM Cortex-M
100 //
101 #elif defined(__ICCARM__)
102 
103 // __NOP should be declared in cmsis header core_cmInstr.h
104 // extern void __NOP(void);
106 #define NOP() __NOP()
107 
108 // No init at startup
109 #define IEC60730_VAR_NO_INIT __attribute__((section(".noinit")))
110 #define IEC60730_DATA_NO_CLEAR __attribute__((section(".ram_no_clear")))
112 
115 #ifndef __STACK_BOTTOM
116 #define __STACK_BOTTOM __attribute__((section(".stack_bottom")))
117 #endif /* __STACK_BOTTOM */
118 
121 #ifndef __CLASSB_RAM
122 #define __CLASSB_RAM __attribute__((section(".classb_ram")))
123 #endif /* __CLASSB_RAM */
124 
127 #ifndef __RT_BUF
128 #define __RT_BUF __attribute__((section(".rt_buf")))
129 #endif /* __RT_BUF */
130 
133 #ifndef __OVERLAP
134 #define __OVERLAP __attribute__((section(".overlap")))
135 #endif /* __OVERLAP */
136 
137 #define LB_ASM __asm
138 #define LB_XSTR(x) XSTR(x::)
139 
140 #else // unknown toolchain
141 #error Unrecognized toolchain in sl_iec60730_toolchain.h
142 #endif
143 
146 #endif /* SL_IEC60730_TOOLCHAIN_H */