Modified for BG96
Fork of mbed-dev by
platform/mbed_toolchain.h@176:447f873cad2f, 2017-10-25 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Oct 25 14:53:38 2017 +0100
- Revision:
- 176:447f873cad2f
- Parent:
- 170:19eb464bc2be
- Child:
- 178:79309dc6340a
This updates the lib to the mbed lib v 154
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
<> | 160:d5399cc887bb | 1 | |
<> | 160:d5399cc887bb | 2 | /** \addtogroup platform */ |
<> | 160:d5399cc887bb | 3 | /** @{*/ |
<> | 160:d5399cc887bb | 4 | /* mbed Microcontroller Library |
<> | 160:d5399cc887bb | 5 | * Copyright (c) 2006-2013 ARM Limited |
<> | 160:d5399cc887bb | 6 | * |
<> | 160:d5399cc887bb | 7 | * Licensed under the Apache License, Version 2.0 (the "License"); |
<> | 160:d5399cc887bb | 8 | * you may not use this file except in compliance with the License. |
<> | 160:d5399cc887bb | 9 | * You may obtain a copy of the License at |
<> | 160:d5399cc887bb | 10 | * |
<> | 160:d5399cc887bb | 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
<> | 160:d5399cc887bb | 12 | * |
<> | 160:d5399cc887bb | 13 | * Unless required by applicable law or agreed to in writing, software |
<> | 160:d5399cc887bb | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
<> | 160:d5399cc887bb | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
<> | 160:d5399cc887bb | 16 | * See the License for the specific language governing permissions and |
<> | 160:d5399cc887bb | 17 | * limitations under the License. |
<> | 160:d5399cc887bb | 18 | */ |
<> | 160:d5399cc887bb | 19 | #ifndef MBED_TOOLCHAIN_H |
<> | 160:d5399cc887bb | 20 | #define MBED_TOOLCHAIN_H |
<> | 160:d5399cc887bb | 21 | |
<> | 160:d5399cc887bb | 22 | #include "mbed_preprocessor.h" |
<> | 160:d5399cc887bb | 23 | |
<> | 160:d5399cc887bb | 24 | |
<> | 160:d5399cc887bb | 25 | // Warning for unsupported compilers |
<> | 160:d5399cc887bb | 26 | #if !defined(__GNUC__) /* GCC */ \ |
<> | 160:d5399cc887bb | 27 | && !defined(__CC_ARM) /* ARMCC */ \ |
<> | 160:d5399cc887bb | 28 | && !defined(__clang__) /* LLVM/Clang */ \ |
<> | 160:d5399cc887bb | 29 | && !defined(__ICCARM__) /* IAR */ |
<> | 160:d5399cc887bb | 30 | #warning "This compiler is not yet supported." |
<> | 160:d5399cc887bb | 31 | #endif |
<> | 160:d5399cc887bb | 32 | |
<> | 160:d5399cc887bb | 33 | |
<> | 160:d5399cc887bb | 34 | // Attributes |
<> | 160:d5399cc887bb | 35 | |
<> | 160:d5399cc887bb | 36 | /** MBED_PACKED |
<> | 160:d5399cc887bb | 37 | * Pack a structure, preventing any padding from being added between fields. |
<> | 160:d5399cc887bb | 38 | * |
<> | 160:d5399cc887bb | 39 | * @code |
<> | 160:d5399cc887bb | 40 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 41 | * |
<> | 160:d5399cc887bb | 42 | * MBED_PACKED(struct) foo { |
<> | 160:d5399cc887bb | 43 | * char x; |
<> | 160:d5399cc887bb | 44 | * int y; |
<> | 160:d5399cc887bb | 45 | * }; |
<> | 160:d5399cc887bb | 46 | * @endcode |
<> | 160:d5399cc887bb | 47 | */ |
<> | 160:d5399cc887bb | 48 | #ifndef MBED_PACKED |
<> | 160:d5399cc887bb | 49 | #if defined(__ICCARM__) |
<> | 160:d5399cc887bb | 50 | #define MBED_PACKED(struct) __packed struct |
<> | 160:d5399cc887bb | 51 | #else |
<> | 160:d5399cc887bb | 52 | #define MBED_PACKED(struct) struct __attribute__((packed)) |
<> | 160:d5399cc887bb | 53 | #endif |
<> | 160:d5399cc887bb | 54 | #endif |
<> | 160:d5399cc887bb | 55 | |
<> | 160:d5399cc887bb | 56 | /** MBED_ALIGN(N) |
<> | 160:d5399cc887bb | 57 | * Declare a variable to be aligned on an N-byte boundary. |
<> | 160:d5399cc887bb | 58 | * |
<> | 160:d5399cc887bb | 59 | * @note |
<> | 160:d5399cc887bb | 60 | * IAR does not support alignment greater than word size on the stack |
<> | 160:d5399cc887bb | 61 | * |
<> | 160:d5399cc887bb | 62 | * @code |
<> | 160:d5399cc887bb | 63 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 64 | * |
<> | 160:d5399cc887bb | 65 | * MBED_ALIGN(16) char a; |
<> | 160:d5399cc887bb | 66 | * @endcode |
<> | 160:d5399cc887bb | 67 | */ |
<> | 160:d5399cc887bb | 68 | #ifndef MBED_ALIGN |
<> | 160:d5399cc887bb | 69 | #if defined(__ICCARM__) |
<> | 160:d5399cc887bb | 70 | #define MBED_ALIGN(N) _Pragma(MBED_STRINGIFY(data_alignment=N)) |
<> | 160:d5399cc887bb | 71 | #else |
<> | 160:d5399cc887bb | 72 | #define MBED_ALIGN(N) __attribute__((aligned(N))) |
<> | 160:d5399cc887bb | 73 | #endif |
<> | 160:d5399cc887bb | 74 | #endif |
<> | 160:d5399cc887bb | 75 | |
<> | 160:d5399cc887bb | 76 | /** MBED_UNUSED |
<> | 160:d5399cc887bb | 77 | * Declare a function argument to be unused, suppressing compiler warnings |
<> | 160:d5399cc887bb | 78 | * |
<> | 160:d5399cc887bb | 79 | * @code |
<> | 160:d5399cc887bb | 80 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 81 | * |
<> | 160:d5399cc887bb | 82 | * void foo(MBED_UNUSED int arg) { |
<> | 160:d5399cc887bb | 83 | * |
<> | 160:d5399cc887bb | 84 | * } |
<> | 160:d5399cc887bb | 85 | * @endcode |
<> | 160:d5399cc887bb | 86 | */ |
<> | 160:d5399cc887bb | 87 | #ifndef MBED_UNUSED |
<> | 160:d5399cc887bb | 88 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 160:d5399cc887bb | 89 | #define MBED_UNUSED __attribute__((__unused__)) |
<> | 160:d5399cc887bb | 90 | #else |
<> | 160:d5399cc887bb | 91 | #define MBED_UNUSED |
<> | 160:d5399cc887bb | 92 | #endif |
<> | 160:d5399cc887bb | 93 | #endif |
<> | 160:d5399cc887bb | 94 | |
AnnaBridge | 176:447f873cad2f | 95 | /** MBED_USED |
AnnaBridge | 176:447f873cad2f | 96 | * Inform the compiler that a static variable is to be retained in the object file, even if it is unreferenced. |
AnnaBridge | 176:447f873cad2f | 97 | * |
AnnaBridge | 176:447f873cad2f | 98 | * @code |
AnnaBridge | 176:447f873cad2f | 99 | * #include "mbed_toolchain.h" |
AnnaBridge | 176:447f873cad2f | 100 | * |
AnnaBridge | 176:447f873cad2f | 101 | * MBED_USED int foo; |
AnnaBridge | 176:447f873cad2f | 102 | * |
AnnaBridge | 176:447f873cad2f | 103 | * @endcode |
AnnaBridge | 176:447f873cad2f | 104 | */ |
AnnaBridge | 176:447f873cad2f | 105 | #ifndef MBED_USED |
AnnaBridge | 176:447f873cad2f | 106 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
AnnaBridge | 176:447f873cad2f | 107 | #define MBED_USED __attribute__((used)) |
AnnaBridge | 176:447f873cad2f | 108 | #elif defined(__ICCARM__) |
AnnaBridge | 176:447f873cad2f | 109 | #define MBED_USED __root |
AnnaBridge | 176:447f873cad2f | 110 | #else |
AnnaBridge | 176:447f873cad2f | 111 | #define MBED_USED |
AnnaBridge | 176:447f873cad2f | 112 | #endif |
AnnaBridge | 176:447f873cad2f | 113 | #endif |
AnnaBridge | 176:447f873cad2f | 114 | |
<> | 160:d5399cc887bb | 115 | /** MBED_WEAK |
<> | 160:d5399cc887bb | 116 | * Mark a function as being weak. |
Kojto | 170:19eb464bc2be | 117 | * |
Kojto | 170:19eb464bc2be | 118 | * @note |
Kojto | 170:19eb464bc2be | 119 | * Functions should only be marked as weak in the source file. The header file |
Kojto | 170:19eb464bc2be | 120 | * should contain a regular function declaration to insure the function is emitted. |
Kojto | 170:19eb464bc2be | 121 | * A function marked weak will not be emitted if an alternative non-weak |
Kojto | 170:19eb464bc2be | 122 | * implementation is defined. |
<> | 160:d5399cc887bb | 123 | * |
<> | 160:d5399cc887bb | 124 | * @note |
Kojto | 170:19eb464bc2be | 125 | * Weak functions are not friendly to making code re-usable, as they can only |
<> | 160:d5399cc887bb | 126 | * be overridden once (and if they are multiply overridden the linker will emit |
<> | 160:d5399cc887bb | 127 | * no warning). You should not normally use weak symbols as part of the API to |
<> | 160:d5399cc887bb | 128 | * re-usable modules. |
<> | 160:d5399cc887bb | 129 | * |
<> | 160:d5399cc887bb | 130 | * @code |
<> | 160:d5399cc887bb | 131 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 132 | * |
<> | 160:d5399cc887bb | 133 | * MBED_WEAK void foo() { |
<> | 160:d5399cc887bb | 134 | * // a weak implementation of foo that can be overriden by a definition |
<> | 160:d5399cc887bb | 135 | * // without __weak |
<> | 160:d5399cc887bb | 136 | * } |
<> | 160:d5399cc887bb | 137 | * @endcode |
<> | 160:d5399cc887bb | 138 | */ |
<> | 160:d5399cc887bb | 139 | #ifndef MBED_WEAK |
<> | 160:d5399cc887bb | 140 | #if defined(__ICCARM__) |
<> | 160:d5399cc887bb | 141 | #define MBED_WEAK __weak |
<> | 160:d5399cc887bb | 142 | #else |
<> | 160:d5399cc887bb | 143 | #define MBED_WEAK __attribute__((weak)) |
<> | 160:d5399cc887bb | 144 | #endif |
<> | 160:d5399cc887bb | 145 | #endif |
<> | 160:d5399cc887bb | 146 | |
<> | 160:d5399cc887bb | 147 | /** MBED_PURE |
<> | 160:d5399cc887bb | 148 | * Hint to the compiler that a function depends only on parameters |
<> | 160:d5399cc887bb | 149 | * |
<> | 160:d5399cc887bb | 150 | * @code |
<> | 160:d5399cc887bb | 151 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 152 | * |
<> | 160:d5399cc887bb | 153 | * MBED_PURE int foo(int arg){ |
<> | 160:d5399cc887bb | 154 | * // no access to global variables |
<> | 160:d5399cc887bb | 155 | * } |
<> | 160:d5399cc887bb | 156 | * @endcode |
<> | 160:d5399cc887bb | 157 | */ |
<> | 160:d5399cc887bb | 158 | #ifndef MBED_PURE |
<> | 160:d5399cc887bb | 159 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 160:d5399cc887bb | 160 | #define MBED_PURE __attribute__((const)) |
<> | 160:d5399cc887bb | 161 | #else |
<> | 160:d5399cc887bb | 162 | #define MBED_PURE |
<> | 160:d5399cc887bb | 163 | #endif |
<> | 160:d5399cc887bb | 164 | #endif |
<> | 160:d5399cc887bb | 165 | |
Kojto | 169:e3b6fe271b81 | 166 | /** MBED_NOINLINE |
Kojto | 169:e3b6fe271b81 | 167 | * Declare a function that must not be inlined. |
Kojto | 169:e3b6fe271b81 | 168 | * |
Kojto | 169:e3b6fe271b81 | 169 | * @code |
Kojto | 169:e3b6fe271b81 | 170 | * #include "mbed_toolchain.h" |
Kojto | 169:e3b6fe271b81 | 171 | * |
Kojto | 169:e3b6fe271b81 | 172 | * MBED_NOINLINE void foo() { |
Kojto | 169:e3b6fe271b81 | 173 | * |
Kojto | 169:e3b6fe271b81 | 174 | * } |
Kojto | 169:e3b6fe271b81 | 175 | * @endcode |
Kojto | 169:e3b6fe271b81 | 176 | */ |
Kojto | 169:e3b6fe271b81 | 177 | #ifndef MBED_NOINLINE |
Kojto | 169:e3b6fe271b81 | 178 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
Kojto | 169:e3b6fe271b81 | 179 | #define MBED_NOINLINE __attribute__((noinline)) |
Kojto | 169:e3b6fe271b81 | 180 | #elif defined(__ICCARM__) |
Kojto | 169:e3b6fe271b81 | 181 | #define MBED_NOINLINE _Pragma("inline=never") |
Kojto | 169:e3b6fe271b81 | 182 | #else |
Kojto | 169:e3b6fe271b81 | 183 | #define MBED_NOINLINE |
Kojto | 169:e3b6fe271b81 | 184 | #endif |
Kojto | 169:e3b6fe271b81 | 185 | #endif |
Kojto | 169:e3b6fe271b81 | 186 | |
<> | 160:d5399cc887bb | 187 | /** MBED_FORCEINLINE |
<> | 160:d5399cc887bb | 188 | * Declare a function that must always be inlined. Failure to inline |
<> | 160:d5399cc887bb | 189 | * such a function will result in an error. |
<> | 160:d5399cc887bb | 190 | * |
<> | 160:d5399cc887bb | 191 | * @code |
<> | 160:d5399cc887bb | 192 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 193 | * |
<> | 160:d5399cc887bb | 194 | * MBED_FORCEINLINE void foo() { |
<> | 160:d5399cc887bb | 195 | * |
<> | 160:d5399cc887bb | 196 | * } |
<> | 160:d5399cc887bb | 197 | * @endcode |
<> | 160:d5399cc887bb | 198 | */ |
<> | 160:d5399cc887bb | 199 | #ifndef MBED_FORCEINLINE |
<> | 160:d5399cc887bb | 200 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 160:d5399cc887bb | 201 | #define MBED_FORCEINLINE static inline __attribute__((always_inline)) |
<> | 160:d5399cc887bb | 202 | #elif defined(__ICCARM__) |
<> | 160:d5399cc887bb | 203 | #define MBED_FORCEINLINE _Pragma("inline=forced") static |
<> | 160:d5399cc887bb | 204 | #else |
<> | 160:d5399cc887bb | 205 | #define MBED_FORCEINLINE static inline |
<> | 160:d5399cc887bb | 206 | #endif |
<> | 160:d5399cc887bb | 207 | #endif |
<> | 160:d5399cc887bb | 208 | |
<> | 160:d5399cc887bb | 209 | /** MBED_NORETURN |
<> | 160:d5399cc887bb | 210 | * Declare a function that will never return. |
<> | 160:d5399cc887bb | 211 | * |
<> | 160:d5399cc887bb | 212 | * @code |
<> | 160:d5399cc887bb | 213 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 214 | * |
<> | 160:d5399cc887bb | 215 | * MBED_NORETURN void foo() { |
<> | 160:d5399cc887bb | 216 | * // must never return |
<> | 160:d5399cc887bb | 217 | * while (1) {} |
<> | 160:d5399cc887bb | 218 | * } |
<> | 160:d5399cc887bb | 219 | * @endcode |
<> | 160:d5399cc887bb | 220 | */ |
<> | 160:d5399cc887bb | 221 | #ifndef MBED_NORETURN |
<> | 160:d5399cc887bb | 222 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 160:d5399cc887bb | 223 | #define MBED_NORETURN __attribute__((noreturn)) |
<> | 160:d5399cc887bb | 224 | #elif defined(__ICCARM__) |
<> | 160:d5399cc887bb | 225 | #define MBED_NORETURN __noreturn |
<> | 160:d5399cc887bb | 226 | #else |
<> | 160:d5399cc887bb | 227 | #define MBED_NORETURN |
<> | 160:d5399cc887bb | 228 | #endif |
<> | 160:d5399cc887bb | 229 | #endif |
<> | 160:d5399cc887bb | 230 | |
<> | 160:d5399cc887bb | 231 | /** MBED_UNREACHABLE |
<> | 160:d5399cc887bb | 232 | * An unreachable statement. If the statement is reached, |
<> | 160:d5399cc887bb | 233 | * behaviour is undefined. Useful in situations where the compiler |
<> | 160:d5399cc887bb | 234 | * cannot deduce the unreachability of code. |
<> | 160:d5399cc887bb | 235 | * |
<> | 160:d5399cc887bb | 236 | * @code |
<> | 160:d5399cc887bb | 237 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 238 | * |
<> | 160:d5399cc887bb | 239 | * void foo(int arg) { |
<> | 160:d5399cc887bb | 240 | * switch (arg) { |
<> | 160:d5399cc887bb | 241 | * case 1: return 1; |
<> | 160:d5399cc887bb | 242 | * case 2: return 2; |
<> | 160:d5399cc887bb | 243 | * ... |
<> | 160:d5399cc887bb | 244 | * } |
<> | 160:d5399cc887bb | 245 | * MBED_UNREACHABLE; |
<> | 160:d5399cc887bb | 246 | * } |
<> | 160:d5399cc887bb | 247 | * @endcode |
<> | 160:d5399cc887bb | 248 | */ |
<> | 160:d5399cc887bb | 249 | #ifndef MBED_UNREACHABLE |
<> | 160:d5399cc887bb | 250 | #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM) |
<> | 160:d5399cc887bb | 251 | #define MBED_UNREACHABLE __builtin_unreachable() |
<> | 160:d5399cc887bb | 252 | #else |
<> | 160:d5399cc887bb | 253 | #define MBED_UNREACHABLE while (1) |
<> | 160:d5399cc887bb | 254 | #endif |
<> | 160:d5399cc887bb | 255 | #endif |
<> | 160:d5399cc887bb | 256 | |
<> | 160:d5399cc887bb | 257 | /** MBED_DEPRECATED("message string") |
<> | 160:d5399cc887bb | 258 | * Mark a function declaration as deprecated, if it used then a warning will be |
<> | 160:d5399cc887bb | 259 | * issued by the compiler possibly including the provided message. Note that not |
<> | 160:d5399cc887bb | 260 | * all compilers are able to display the message. |
<> | 160:d5399cc887bb | 261 | * |
<> | 160:d5399cc887bb | 262 | * @code |
<> | 160:d5399cc887bb | 263 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 264 | * |
<> | 160:d5399cc887bb | 265 | * MBED_DEPRECATED("don't foo any more, bar instead") |
<> | 160:d5399cc887bb | 266 | * void foo(int arg); |
<> | 160:d5399cc887bb | 267 | * @endcode |
<> | 160:d5399cc887bb | 268 | */ |
<> | 160:d5399cc887bb | 269 | #ifndef MBED_DEPRECATED |
<> | 160:d5399cc887bb | 270 | #if defined(__CC_ARM) |
<> | 160:d5399cc887bb | 271 | #define MBED_DEPRECATED(M) __attribute__((deprecated)) |
<> | 160:d5399cc887bb | 272 | #elif defined(__GNUC__) || defined(__clang__) |
<> | 160:d5399cc887bb | 273 | #define MBED_DEPRECATED(M) __attribute__((deprecated(M))) |
<> | 160:d5399cc887bb | 274 | #else |
<> | 160:d5399cc887bb | 275 | #define MBED_DEPRECATED(M) |
<> | 160:d5399cc887bb | 276 | #endif |
<> | 160:d5399cc887bb | 277 | #endif |
<> | 160:d5399cc887bb | 278 | |
<> | 160:d5399cc887bb | 279 | /** MBED_DEPRECATED_SINCE("version", "message string") |
<> | 160:d5399cc887bb | 280 | * Mark a function declaration as deprecated, noting that the declaration was |
<> | 160:d5399cc887bb | 281 | * deprecated on the specified version. If the function is used then a warning |
<> | 160:d5399cc887bb | 282 | * will be issued by the compiler possibly including the provided message. |
<> | 160:d5399cc887bb | 283 | * Note that not all compilers are able to display this message. |
<> | 160:d5399cc887bb | 284 | * |
<> | 160:d5399cc887bb | 285 | * @code |
<> | 160:d5399cc887bb | 286 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 287 | * |
<> | 160:d5399cc887bb | 288 | * MBED_DEPRECATED_SINCE("mbed-os-5.1", "don't foo any more, bar instead") |
<> | 160:d5399cc887bb | 289 | * void foo(int arg); |
<> | 160:d5399cc887bb | 290 | * @endcode |
<> | 160:d5399cc887bb | 291 | */ |
<> | 160:d5399cc887bb | 292 | #define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]") |
<> | 160:d5399cc887bb | 293 | |
<> | 160:d5399cc887bb | 294 | /** MBED_CALLER_ADDR() |
<> | 160:d5399cc887bb | 295 | * Returns the caller of the current function. |
<> | 160:d5399cc887bb | 296 | * |
<> | 160:d5399cc887bb | 297 | * @note |
<> | 160:d5399cc887bb | 298 | * This macro is only implemented for GCC and ARMCC. |
<> | 160:d5399cc887bb | 299 | * |
<> | 160:d5399cc887bb | 300 | * @code |
<> | 160:d5399cc887bb | 301 | * #include "mbed_toolchain.h" |
<> | 160:d5399cc887bb | 302 | * |
<> | 160:d5399cc887bb | 303 | * printf("This function was called from %p", MBED_CALLER_ADDR()); |
<> | 160:d5399cc887bb | 304 | * @endcode |
<> | 160:d5399cc887bb | 305 | * |
<> | 160:d5399cc887bb | 306 | * @return Address of the calling function |
<> | 160:d5399cc887bb | 307 | */ |
<> | 160:d5399cc887bb | 308 | #ifndef MBED_CALLER_ADDR |
<> | 160:d5399cc887bb | 309 | #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM) |
<> | 160:d5399cc887bb | 310 | #define MBED_CALLER_ADDR() __builtin_extract_return_addr(__builtin_return_address(0)) |
<> | 160:d5399cc887bb | 311 | #elif defined(__CC_ARM) |
<> | 160:d5399cc887bb | 312 | #define MBED_CALLER_ADDR() __builtin_return_address(0) |
<> | 160:d5399cc887bb | 313 | #else |
<> | 160:d5399cc887bb | 314 | #define MBED_CALLER_ADDR() (NULL) |
<> | 160:d5399cc887bb | 315 | #endif |
<> | 160:d5399cc887bb | 316 | #endif |
<> | 160:d5399cc887bb | 317 | |
<> | 160:d5399cc887bb | 318 | #ifndef MBED_SECTION |
<> | 160:d5399cc887bb | 319 | #if (defined(__GNUC__) || defined(__clang__)) || defined(__CC_ARM) |
<> | 160:d5399cc887bb | 320 | #define MBED_SECTION(name) __attribute__ ((section (name))) |
<> | 160:d5399cc887bb | 321 | #elif defined(__ICCARM__) |
<> | 160:d5399cc887bb | 322 | #define MBED_SECTION(name) _Pragma(MBED_STRINGIFY(location=name)) |
<> | 160:d5399cc887bb | 323 | #else |
<> | 160:d5399cc887bb | 324 | #error "Missing MBED_SECTION directive" |
<> | 160:d5399cc887bb | 325 | #endif |
<> | 160:d5399cc887bb | 326 | #endif |
<> | 160:d5399cc887bb | 327 | |
AnnaBridge | 167:e84263d55307 | 328 | #ifndef MBED_PRINTF |
AnnaBridge | 167:e84263d55307 | 329 | #if defined(__GNUC__) || defined(__CC_ARM) |
AnnaBridge | 167:e84263d55307 | 330 | #define MBED_PRINTF(format_idx, first_param_idx) __attribute__ ((__format__(__printf__, format_idx, first_param_idx))) |
AnnaBridge | 167:e84263d55307 | 331 | #else |
AnnaBridge | 167:e84263d55307 | 332 | #define MBED_PRINTF(format_idx, first_param_idx) |
AnnaBridge | 167:e84263d55307 | 333 | #endif |
AnnaBridge | 167:e84263d55307 | 334 | #endif |
AnnaBridge | 167:e84263d55307 | 335 | |
AnnaBridge | 167:e84263d55307 | 336 | #ifndef MBED_PRINTF_METHOD |
AnnaBridge | 167:e84263d55307 | 337 | #if defined(__GNUC__) || defined(__CC_ARM) |
AnnaBridge | 167:e84263d55307 | 338 | #define MBED_PRINTF_METHOD(format_idx, first_param_idx) __attribute__ ((__format__(__printf__, format_idx+1, first_param_idx+1))) |
AnnaBridge | 167:e84263d55307 | 339 | #else |
AnnaBridge | 167:e84263d55307 | 340 | #define MBED_PRINTF_METHOD(format_idx, first_param_idx) |
AnnaBridge | 167:e84263d55307 | 341 | #endif |
AnnaBridge | 167:e84263d55307 | 342 | #endif |
AnnaBridge | 167:e84263d55307 | 343 | |
AnnaBridge | 167:e84263d55307 | 344 | #ifndef MBED_SCANF |
AnnaBridge | 167:e84263d55307 | 345 | #if defined(__GNUC__) || defined(__CC_ARM) |
AnnaBridge | 167:e84263d55307 | 346 | #define MBED_SCANF(format_idx, first_param_idx) __attribute__ ((__format__(__scanf__, format_idx, first_param_idx))) |
AnnaBridge | 167:e84263d55307 | 347 | #else |
AnnaBridge | 167:e84263d55307 | 348 | #define MBED_SCANF(format_idx, first_param_idx) |
AnnaBridge | 167:e84263d55307 | 349 | #endif |
AnnaBridge | 167:e84263d55307 | 350 | #endif |
AnnaBridge | 167:e84263d55307 | 351 | |
AnnaBridge | 167:e84263d55307 | 352 | #ifndef MBED_SCANF_METHOD |
AnnaBridge | 167:e84263d55307 | 353 | #if defined(__GNUC__) || defined(__CC_ARM) |
AnnaBridge | 167:e84263d55307 | 354 | #define MBED_SCANF_METHOD(format_idx, first_param_idx) __attribute__ ((__format__(__scanf__, format_idx+1, first_param_idx+1))) |
AnnaBridge | 167:e84263d55307 | 355 | #else |
AnnaBridge | 167:e84263d55307 | 356 | #define MBED_SCANF_METHOD(format_idx, first_param_idx) |
AnnaBridge | 167:e84263d55307 | 357 | #endif |
AnnaBridge | 167:e84263d55307 | 358 | #endif |
AnnaBridge | 167:e84263d55307 | 359 | |
<> | 160:d5399cc887bb | 360 | // FILEHANDLE declaration |
<> | 160:d5399cc887bb | 361 | #if defined(TOOLCHAIN_ARM) |
<> | 160:d5399cc887bb | 362 | #include <rt_sys.h> |
<> | 160:d5399cc887bb | 363 | #endif |
<> | 160:d5399cc887bb | 364 | |
<> | 160:d5399cc887bb | 365 | #ifndef FILEHANDLE |
<> | 160:d5399cc887bb | 366 | typedef int FILEHANDLE; |
<> | 160:d5399cc887bb | 367 | #endif |
<> | 160:d5399cc887bb | 368 | |
<> | 160:d5399cc887bb | 369 | // Backwards compatibility |
<> | 160:d5399cc887bb | 370 | #ifndef WEAK |
<> | 160:d5399cc887bb | 371 | #define WEAK MBED_WEAK |
<> | 160:d5399cc887bb | 372 | #endif |
<> | 160:d5399cc887bb | 373 | |
<> | 160:d5399cc887bb | 374 | #ifndef PACKED |
<> | 160:d5399cc887bb | 375 | #define PACKED MBED_PACKED() |
<> | 160:d5399cc887bb | 376 | #endif |
<> | 160:d5399cc887bb | 377 | |
<> | 160:d5399cc887bb | 378 | #ifndef EXTERN |
<> | 160:d5399cc887bb | 379 | #define EXTERN extern |
<> | 160:d5399cc887bb | 380 | #endif |
<> | 160:d5399cc887bb | 381 | |
<> | 160:d5399cc887bb | 382 | #endif |
<> | 160:d5399cc887bb | 383 | |
<> | 160:d5399cc887bb | 384 | /** @}*/ |