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.
platform/mbed_toolchain.h@140:97feb9bacc10, 2017-04-12 (annotated)
- Committer:
- <>
- Date:
- Wed Apr 12 16:07:08 2017 +0100
- Revision:
- 140:97feb9bacc10
- Parent:
- 138:093f2bd7b9eb
- Child:
- 145:64910690c574
Release 140 of the mbed library
Ports for Upcoming Targets
3841: Add nRf52840 target https://github.com/ARMmbed/mbed-os/pull/3841
3992: Introducing UBLOX_C030 platform. https://github.com/ARMmbed/mbed-os/pull/3992
Fixes and Changes
3951: [NUCLEO_F303ZE] Correct ARDUINO pin https://github.com/ARMmbed/mbed-os/pull/3951
4021: Fixing a macro to detect when RTOS was in use for the NRF52840_DK https://github.com/ARMmbed/mbed-os/pull/4021
3979: KW24D: Add missing SPI defines and Arduino connector definitions https://github.com/ARMmbed/mbed-os/pull/3979
3990: UBLOX_C027: construct a ticker-based wait, rather than calling wait_ms(), in the https://github.com/ARMmbed/mbed-os/pull/3990
4003: Fixed OBOE in async serial tx for NRF52 target, fixes #4002 https://github.com/ARMmbed/mbed-os/pull/4003
4012: STM32: Correct I2C master error handling https://github.com/ARMmbed/mbed-os/pull/4012
4020: NUCLEO_L011K4 remove unsupported tool chain files https://github.com/ARMmbed/mbed-os/pull/4020
4065: K66F: Move bss section to m_data_2 Section https://github.com/ARMmbed/mbed-os/pull/4065
4014: Issue 3763: Reduce heap allocation in the GCC linker file https://github.com/ARMmbed/mbed-os/pull/4014
4030: [STM32L0] reduce IAR heap and stack size for small targets https://github.com/ARMmbed/mbed-os/pull/4030
4109: NUCLEO_L476RG : minor serial pin update https://github.com/ARMmbed/mbed-os/pull/4109
3982: Ticker - kl25z bugfix for handling events in the past https://github.com/ARMmbed/mbed-os/pull/3982
Who changed what in which revision?
User | Revision | Line number | New 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 | |
<> | 138:093f2bd7b9eb | 95 | /** MBED_WEAK |
<> | 138:093f2bd7b9eb | 96 | * Mark a function as being weak. |
<> | 138:093f2bd7b9eb | 97 | * |
<> | 138:093f2bd7b9eb | 98 | * @note |
<> | 138:093f2bd7b9eb | 99 | * weak functions are not friendly to making code re-usable, as they can only |
<> | 138:093f2bd7b9eb | 100 | * be overridden once (and if they are multiply overridden the linker will emit |
<> | 138:093f2bd7b9eb | 101 | * no warning). You should not normally use weak symbols as part of the API to |
<> | 138:093f2bd7b9eb | 102 | * re-usable modules. |
<> | 138:093f2bd7b9eb | 103 | * |
<> | 138:093f2bd7b9eb | 104 | * @code |
<> | 138:093f2bd7b9eb | 105 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 106 | * |
<> | 138:093f2bd7b9eb | 107 | * MBED_WEAK void foo() { |
<> | 138:093f2bd7b9eb | 108 | * // a weak implementation of foo that can be overriden by a definition |
<> | 138:093f2bd7b9eb | 109 | * // without __weak |
<> | 138:093f2bd7b9eb | 110 | * } |
<> | 138:093f2bd7b9eb | 111 | * @endcode |
<> | 138:093f2bd7b9eb | 112 | */ |
<> | 138:093f2bd7b9eb | 113 | #ifndef MBED_WEAK |
<> | 138:093f2bd7b9eb | 114 | #if defined(__ICCARM__) |
<> | 138:093f2bd7b9eb | 115 | #define MBED_WEAK __weak |
<> | 138:093f2bd7b9eb | 116 | #else |
<> | 138:093f2bd7b9eb | 117 | #define MBED_WEAK __attribute__((weak)) |
<> | 138:093f2bd7b9eb | 118 | #endif |
<> | 138:093f2bd7b9eb | 119 | #endif |
<> | 138:093f2bd7b9eb | 120 | |
<> | 138:093f2bd7b9eb | 121 | /** MBED_PURE |
<> | 138:093f2bd7b9eb | 122 | * Hint to the compiler that a function depends only on parameters |
<> | 138:093f2bd7b9eb | 123 | * |
<> | 138:093f2bd7b9eb | 124 | * @code |
<> | 138:093f2bd7b9eb | 125 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 126 | * |
<> | 138:093f2bd7b9eb | 127 | * MBED_PURE int foo(int arg){ |
<> | 138:093f2bd7b9eb | 128 | * // no access to global variables |
<> | 138:093f2bd7b9eb | 129 | * } |
<> | 138:093f2bd7b9eb | 130 | * @endcode |
<> | 138:093f2bd7b9eb | 131 | */ |
<> | 138:093f2bd7b9eb | 132 | #ifndef MBED_PURE |
<> | 138:093f2bd7b9eb | 133 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 134 | #define MBED_PURE __attribute__((const)) |
<> | 138:093f2bd7b9eb | 135 | #else |
<> | 138:093f2bd7b9eb | 136 | #define MBED_PURE |
<> | 138:093f2bd7b9eb | 137 | #endif |
<> | 138:093f2bd7b9eb | 138 | #endif |
<> | 138:093f2bd7b9eb | 139 | |
<> | 138:093f2bd7b9eb | 140 | /** MBED_FORCEINLINE |
<> | 138:093f2bd7b9eb | 141 | * Declare a function that must always be inlined. Failure to inline |
<> | 138:093f2bd7b9eb | 142 | * such a function will result in an error. |
<> | 138:093f2bd7b9eb | 143 | * |
<> | 138:093f2bd7b9eb | 144 | * @code |
<> | 138:093f2bd7b9eb | 145 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 146 | * |
<> | 138:093f2bd7b9eb | 147 | * MBED_FORCEINLINE void foo() { |
<> | 138:093f2bd7b9eb | 148 | * |
<> | 138:093f2bd7b9eb | 149 | * } |
<> | 138:093f2bd7b9eb | 150 | * @endcode |
<> | 138:093f2bd7b9eb | 151 | */ |
<> | 138:093f2bd7b9eb | 152 | #ifndef MBED_FORCEINLINE |
<> | 138:093f2bd7b9eb | 153 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 154 | #define MBED_FORCEINLINE static inline __attribute__((always_inline)) |
<> | 138:093f2bd7b9eb | 155 | #elif defined(__ICCARM__) |
<> | 138:093f2bd7b9eb | 156 | #define MBED_FORCEINLINE _Pragma("inline=forced") static |
<> | 138:093f2bd7b9eb | 157 | #else |
<> | 138:093f2bd7b9eb | 158 | #define MBED_FORCEINLINE static inline |
<> | 138:093f2bd7b9eb | 159 | #endif |
<> | 138:093f2bd7b9eb | 160 | #endif |
<> | 138:093f2bd7b9eb | 161 | |
<> | 138:093f2bd7b9eb | 162 | /** MBED_NORETURN |
<> | 138:093f2bd7b9eb | 163 | * Declare a function that will never return. |
<> | 138:093f2bd7b9eb | 164 | * |
<> | 138:093f2bd7b9eb | 165 | * @code |
<> | 138:093f2bd7b9eb | 166 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 167 | * |
<> | 138:093f2bd7b9eb | 168 | * MBED_NORETURN void foo() { |
<> | 138:093f2bd7b9eb | 169 | * // must never return |
<> | 138:093f2bd7b9eb | 170 | * while (1) {} |
<> | 138:093f2bd7b9eb | 171 | * } |
<> | 138:093f2bd7b9eb | 172 | * @endcode |
<> | 138:093f2bd7b9eb | 173 | */ |
<> | 138:093f2bd7b9eb | 174 | #ifndef MBED_NORETURN |
<> | 138:093f2bd7b9eb | 175 | #if defined(__GNUC__) || defined(__clang__) || defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 176 | #define MBED_NORETURN __attribute__((noreturn)) |
<> | 138:093f2bd7b9eb | 177 | #elif defined(__ICCARM__) |
<> | 138:093f2bd7b9eb | 178 | #define MBED_NORETURN __noreturn |
<> | 138:093f2bd7b9eb | 179 | #else |
<> | 138:093f2bd7b9eb | 180 | #define MBED_NORETURN |
<> | 138:093f2bd7b9eb | 181 | #endif |
<> | 138:093f2bd7b9eb | 182 | #endif |
<> | 138:093f2bd7b9eb | 183 | |
<> | 138:093f2bd7b9eb | 184 | /** MBED_UNREACHABLE |
<> | 138:093f2bd7b9eb | 185 | * An unreachable statement. If the statement is reached, |
<> | 138:093f2bd7b9eb | 186 | * behaviour is undefined. Useful in situations where the compiler |
<> | 138:093f2bd7b9eb | 187 | * cannot deduce the unreachability of code. |
<> | 138:093f2bd7b9eb | 188 | * |
<> | 138:093f2bd7b9eb | 189 | * @code |
<> | 138:093f2bd7b9eb | 190 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 191 | * |
<> | 138:093f2bd7b9eb | 192 | * void foo(int arg) { |
<> | 138:093f2bd7b9eb | 193 | * switch (arg) { |
<> | 138:093f2bd7b9eb | 194 | * case 1: return 1; |
<> | 138:093f2bd7b9eb | 195 | * case 2: return 2; |
<> | 138:093f2bd7b9eb | 196 | * ... |
<> | 138:093f2bd7b9eb | 197 | * } |
<> | 138:093f2bd7b9eb | 198 | * MBED_UNREACHABLE; |
<> | 138:093f2bd7b9eb | 199 | * } |
<> | 138:093f2bd7b9eb | 200 | * @endcode |
<> | 138:093f2bd7b9eb | 201 | */ |
<> | 138:093f2bd7b9eb | 202 | #ifndef MBED_UNREACHABLE |
<> | 138:093f2bd7b9eb | 203 | #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 204 | #define MBED_UNREACHABLE __builtin_unreachable() |
<> | 138:093f2bd7b9eb | 205 | #else |
<> | 138:093f2bd7b9eb | 206 | #define MBED_UNREACHABLE while (1) |
<> | 138:093f2bd7b9eb | 207 | #endif |
<> | 138:093f2bd7b9eb | 208 | #endif |
<> | 138:093f2bd7b9eb | 209 | |
<> | 138:093f2bd7b9eb | 210 | /** MBED_DEPRECATED("message string") |
<> | 138:093f2bd7b9eb | 211 | * Mark a function declaration as deprecated, if it used then a warning will be |
<> | 138:093f2bd7b9eb | 212 | * issued by the compiler possibly including the provided message. Note that not |
<> | 138:093f2bd7b9eb | 213 | * all compilers are able to display the message. |
<> | 138:093f2bd7b9eb | 214 | * |
<> | 138:093f2bd7b9eb | 215 | * @code |
<> | 138:093f2bd7b9eb | 216 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 217 | * |
<> | 138:093f2bd7b9eb | 218 | * MBED_DEPRECATED("don't foo any more, bar instead") |
<> | 138:093f2bd7b9eb | 219 | * void foo(int arg); |
<> | 138:093f2bd7b9eb | 220 | * @endcode |
<> | 138:093f2bd7b9eb | 221 | */ |
<> | 138:093f2bd7b9eb | 222 | #ifndef MBED_DEPRECATED |
<> | 138:093f2bd7b9eb | 223 | #if defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 224 | #define MBED_DEPRECATED(M) __attribute__((deprecated)) |
<> | 138:093f2bd7b9eb | 225 | #elif defined(__GNUC__) || defined(__clang__) |
<> | 138:093f2bd7b9eb | 226 | #define MBED_DEPRECATED(M) __attribute__((deprecated(M))) |
<> | 138:093f2bd7b9eb | 227 | #else |
<> | 138:093f2bd7b9eb | 228 | #define MBED_DEPRECATED(M) |
<> | 138:093f2bd7b9eb | 229 | #endif |
<> | 138:093f2bd7b9eb | 230 | #endif |
<> | 138:093f2bd7b9eb | 231 | |
<> | 138:093f2bd7b9eb | 232 | /** MBED_DEPRECATED_SINCE("version", "message string") |
<> | 138:093f2bd7b9eb | 233 | * Mark a function declaration as deprecated, noting that the declaration was |
<> | 138:093f2bd7b9eb | 234 | * deprecated on the specified version. If the function is used then a warning |
<> | 138:093f2bd7b9eb | 235 | * will be issued by the compiler possibly including the provided message. |
<> | 138:093f2bd7b9eb | 236 | * Note that not all compilers are able to display this message. |
<> | 138:093f2bd7b9eb | 237 | * |
<> | 138:093f2bd7b9eb | 238 | * @code |
<> | 138:093f2bd7b9eb | 239 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 240 | * |
<> | 138:093f2bd7b9eb | 241 | * MBED_DEPRECATED_SINCE("mbed-os-5.1", "don't foo any more, bar instead") |
<> | 138:093f2bd7b9eb | 242 | * void foo(int arg); |
<> | 138:093f2bd7b9eb | 243 | * @endcode |
<> | 138:093f2bd7b9eb | 244 | */ |
<> | 138:093f2bd7b9eb | 245 | #define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]") |
<> | 138:093f2bd7b9eb | 246 | |
<> | 138:093f2bd7b9eb | 247 | /** MBED_CALLER_ADDR() |
<> | 138:093f2bd7b9eb | 248 | * Returns the caller of the current function. |
<> | 138:093f2bd7b9eb | 249 | * |
<> | 138:093f2bd7b9eb | 250 | * @note |
<> | 138:093f2bd7b9eb | 251 | * This macro is only implemented for GCC and ARMCC. |
<> | 138:093f2bd7b9eb | 252 | * |
<> | 138:093f2bd7b9eb | 253 | * @code |
<> | 138:093f2bd7b9eb | 254 | * #include "mbed_toolchain.h" |
<> | 138:093f2bd7b9eb | 255 | * |
<> | 138:093f2bd7b9eb | 256 | * printf("This function was called from %p", MBED_CALLER_ADDR()); |
<> | 138:093f2bd7b9eb | 257 | * @endcode |
<> | 138:093f2bd7b9eb | 258 | * |
<> | 138:093f2bd7b9eb | 259 | * @return Address of the calling function |
<> | 138:093f2bd7b9eb | 260 | */ |
<> | 138:093f2bd7b9eb | 261 | #ifndef MBED_CALLER_ADDR |
<> | 138:093f2bd7b9eb | 262 | #if (defined(__GNUC__) || defined(__clang__)) && !defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 263 | #define MBED_CALLER_ADDR() __builtin_extract_return_addr(__builtin_return_address(0)) |
<> | 138:093f2bd7b9eb | 264 | #elif defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 265 | #define MBED_CALLER_ADDR() __builtin_return_address(0) |
<> | 138:093f2bd7b9eb | 266 | #else |
<> | 138:093f2bd7b9eb | 267 | #define MBED_CALLER_ADDR() (NULL) |
<> | 138:093f2bd7b9eb | 268 | #endif |
<> | 138:093f2bd7b9eb | 269 | #endif |
<> | 138:093f2bd7b9eb | 270 | |
<> | 138:093f2bd7b9eb | 271 | #ifndef MBED_SECTION |
<> | 138:093f2bd7b9eb | 272 | #if (defined(__GNUC__) || defined(__clang__)) || defined(__CC_ARM) |
<> | 138:093f2bd7b9eb | 273 | #define MBED_SECTION(name) __attribute__ ((section (name))) |
<> | 138:093f2bd7b9eb | 274 | #elif defined(__ICCARM__) |
<> | 138:093f2bd7b9eb | 275 | #define MBED_SECTION(name) _Pragma(MBED_STRINGIFY(location=name)) |
<> | 138:093f2bd7b9eb | 276 | #else |
<> | 138:093f2bd7b9eb | 277 | #error "Missing MBED_SECTION directive" |
<> | 138:093f2bd7b9eb | 278 | #endif |
<> | 138:093f2bd7b9eb | 279 | #endif |
<> | 138:093f2bd7b9eb | 280 | |
<> | 138:093f2bd7b9eb | 281 | // FILEHANDLE declaration |
<> | 138:093f2bd7b9eb | 282 | #if defined(TOOLCHAIN_ARM) |
<> | 138:093f2bd7b9eb | 283 | #include <rt_sys.h> |
<> | 138:093f2bd7b9eb | 284 | #endif |
<> | 138:093f2bd7b9eb | 285 | |
<> | 138:093f2bd7b9eb | 286 | #ifndef FILEHANDLE |
<> | 138:093f2bd7b9eb | 287 | typedef int FILEHANDLE; |
<> | 138:093f2bd7b9eb | 288 | #endif |
<> | 138:093f2bd7b9eb | 289 | |
<> | 138:093f2bd7b9eb | 290 | // Backwards compatibility |
<> | 138:093f2bd7b9eb | 291 | #ifndef WEAK |
<> | 138:093f2bd7b9eb | 292 | #define WEAK MBED_WEAK |
<> | 138:093f2bd7b9eb | 293 | #endif |
<> | 138:093f2bd7b9eb | 294 | |
<> | 138:093f2bd7b9eb | 295 | #ifndef PACKED |
<> | 138:093f2bd7b9eb | 296 | #define PACKED MBED_PACKED() |
<> | 138:093f2bd7b9eb | 297 | #endif |
<> | 138:093f2bd7b9eb | 298 | |
<> | 138:093f2bd7b9eb | 299 | #ifndef EXTERN |
<> | 138:093f2bd7b9eb | 300 | #define EXTERN extern |
<> | 138:093f2bd7b9eb | 301 | #endif |
<> | 138:093f2bd7b9eb | 302 | |
<> | 138:093f2bd7b9eb | 303 | #endif |
<> | 138:093f2bd7b9eb | 304 | |
<> | 138:093f2bd7b9eb | 305 | /** @}*/ |