The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
AnnaBridge
Date:
Wed Oct 25 14:40:21 2017 +0100
Revision:
154:fb8e0ae1cceb
Parent:
148:fd96258d940d
Release 154 of the mbed library.

Who changed what in which revision?

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