RTC auf true
cmsis/TARGET_CORTEX_M/cmsis_compiler.h@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | /**************************************************************************//** |
kevman | 0:38ceb79fef03 | 2 | * @file cmsis_compiler.h |
kevman | 0:38ceb79fef03 | 3 | * @brief CMSIS compiler generic header file |
kevman | 0:38ceb79fef03 | 4 | * @version V5.0.4 |
kevman | 0:38ceb79fef03 | 5 | * @date 10. January 2018 |
kevman | 0:38ceb79fef03 | 6 | ******************************************************************************/ |
kevman | 0:38ceb79fef03 | 7 | /* |
kevman | 0:38ceb79fef03 | 8 | * Copyright (c) 2009-2018 Arm Limited. All rights reserved. |
kevman | 0:38ceb79fef03 | 9 | * |
kevman | 0:38ceb79fef03 | 10 | * SPDX-License-Identifier: Apache-2.0 |
kevman | 0:38ceb79fef03 | 11 | * |
kevman | 0:38ceb79fef03 | 12 | * Licensed under the Apache License, Version 2.0 (the License); you may |
kevman | 0:38ceb79fef03 | 13 | * not use this file except in compliance with the License. |
kevman | 0:38ceb79fef03 | 14 | * You may obtain a copy of the License at |
kevman | 0:38ceb79fef03 | 15 | * |
kevman | 0:38ceb79fef03 | 16 | * www.apache.org/licenses/LICENSE-2.0 |
kevman | 0:38ceb79fef03 | 17 | * |
kevman | 0:38ceb79fef03 | 18 | * Unless required by applicable law or agreed to in writing, software |
kevman | 0:38ceb79fef03 | 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT |
kevman | 0:38ceb79fef03 | 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
kevman | 0:38ceb79fef03 | 21 | * See the License for the specific language governing permissions and |
kevman | 0:38ceb79fef03 | 22 | * limitations under the License. |
kevman | 0:38ceb79fef03 | 23 | */ |
kevman | 0:38ceb79fef03 | 24 | |
kevman | 0:38ceb79fef03 | 25 | #ifndef __CMSIS_COMPILER_H |
kevman | 0:38ceb79fef03 | 26 | #define __CMSIS_COMPILER_H |
kevman | 0:38ceb79fef03 | 27 | |
kevman | 0:38ceb79fef03 | 28 | #include <stdint.h> |
kevman | 0:38ceb79fef03 | 29 | |
kevman | 0:38ceb79fef03 | 30 | /* |
kevman | 0:38ceb79fef03 | 31 | * Arm Compiler 4/5 |
kevman | 0:38ceb79fef03 | 32 | */ |
kevman | 0:38ceb79fef03 | 33 | #if defined ( __CC_ARM ) |
kevman | 0:38ceb79fef03 | 34 | #include "cmsis_armcc.h" |
kevman | 0:38ceb79fef03 | 35 | |
kevman | 0:38ceb79fef03 | 36 | |
kevman | 0:38ceb79fef03 | 37 | /* |
kevman | 0:38ceb79fef03 | 38 | * Arm Compiler 6 (armclang) |
kevman | 0:38ceb79fef03 | 39 | */ |
kevman | 0:38ceb79fef03 | 40 | #elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
kevman | 0:38ceb79fef03 | 41 | #include "cmsis_armclang.h" |
kevman | 0:38ceb79fef03 | 42 | |
kevman | 0:38ceb79fef03 | 43 | |
kevman | 0:38ceb79fef03 | 44 | /* |
kevman | 0:38ceb79fef03 | 45 | * GNU Compiler |
kevman | 0:38ceb79fef03 | 46 | */ |
kevman | 0:38ceb79fef03 | 47 | #elif defined ( __GNUC__ ) |
kevman | 0:38ceb79fef03 | 48 | #include "cmsis_gcc.h" |
kevman | 0:38ceb79fef03 | 49 | |
kevman | 0:38ceb79fef03 | 50 | |
kevman | 0:38ceb79fef03 | 51 | /* |
kevman | 0:38ceb79fef03 | 52 | * IAR Compiler |
kevman | 0:38ceb79fef03 | 53 | */ |
kevman | 0:38ceb79fef03 | 54 | #elif defined ( __ICCARM__ ) |
kevman | 0:38ceb79fef03 | 55 | #include <cmsis_iccarm.h> |
kevman | 0:38ceb79fef03 | 56 | |
kevman | 0:38ceb79fef03 | 57 | |
kevman | 0:38ceb79fef03 | 58 | /* |
kevman | 0:38ceb79fef03 | 59 | * TI Arm Compiler |
kevman | 0:38ceb79fef03 | 60 | */ |
kevman | 0:38ceb79fef03 | 61 | #elif defined ( __TI_ARM__ ) |
kevman | 0:38ceb79fef03 | 62 | #include <cmsis_ccs.h> |
kevman | 0:38ceb79fef03 | 63 | |
kevman | 0:38ceb79fef03 | 64 | #ifndef __ASM |
kevman | 0:38ceb79fef03 | 65 | #define __ASM __asm |
kevman | 0:38ceb79fef03 | 66 | #endif |
kevman | 0:38ceb79fef03 | 67 | #ifndef __INLINE |
kevman | 0:38ceb79fef03 | 68 | #define __INLINE inline |
kevman | 0:38ceb79fef03 | 69 | #endif |
kevman | 0:38ceb79fef03 | 70 | #ifndef __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 71 | #define __STATIC_INLINE static inline |
kevman | 0:38ceb79fef03 | 72 | #endif |
kevman | 0:38ceb79fef03 | 73 | #ifndef __STATIC_FORCEINLINE |
kevman | 0:38ceb79fef03 | 74 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 75 | #endif |
kevman | 0:38ceb79fef03 | 76 | #ifndef __NO_RETURN |
kevman | 0:38ceb79fef03 | 77 | #define __NO_RETURN __attribute__((noreturn)) |
kevman | 0:38ceb79fef03 | 78 | #endif |
kevman | 0:38ceb79fef03 | 79 | #ifndef __USED |
kevman | 0:38ceb79fef03 | 80 | #define __USED __attribute__((used)) |
kevman | 0:38ceb79fef03 | 81 | #endif |
kevman | 0:38ceb79fef03 | 82 | #ifndef __WEAK |
kevman | 0:38ceb79fef03 | 83 | #define __WEAK __attribute__((weak)) |
kevman | 0:38ceb79fef03 | 84 | #endif |
kevman | 0:38ceb79fef03 | 85 | #ifndef __PACKED |
kevman | 0:38ceb79fef03 | 86 | #define __PACKED __attribute__((packed)) |
kevman | 0:38ceb79fef03 | 87 | #endif |
kevman | 0:38ceb79fef03 | 88 | #ifndef __PACKED_STRUCT |
kevman | 0:38ceb79fef03 | 89 | #define __PACKED_STRUCT struct __attribute__((packed)) |
kevman | 0:38ceb79fef03 | 90 | #endif |
kevman | 0:38ceb79fef03 | 91 | #ifndef __PACKED_UNION |
kevman | 0:38ceb79fef03 | 92 | #define __PACKED_UNION union __attribute__((packed)) |
kevman | 0:38ceb79fef03 | 93 | #endif |
kevman | 0:38ceb79fef03 | 94 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
kevman | 0:38ceb79fef03 | 95 | struct __attribute__((packed)) T_UINT32 { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 96 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
kevman | 0:38ceb79fef03 | 97 | #endif |
kevman | 0:38ceb79fef03 | 98 | #ifndef __UNALIGNED_UINT16_WRITE |
kevman | 0:38ceb79fef03 | 99 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 100 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 101 | #endif |
kevman | 0:38ceb79fef03 | 102 | #ifndef __UNALIGNED_UINT16_READ |
kevman | 0:38ceb79fef03 | 103 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 104 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 105 | #endif |
kevman | 0:38ceb79fef03 | 106 | #ifndef __UNALIGNED_UINT32_WRITE |
kevman | 0:38ceb79fef03 | 107 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 108 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 109 | #endif |
kevman | 0:38ceb79fef03 | 110 | #ifndef __UNALIGNED_UINT32_READ |
kevman | 0:38ceb79fef03 | 111 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 112 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 113 | #endif |
kevman | 0:38ceb79fef03 | 114 | #ifndef __ALIGNED |
kevman | 0:38ceb79fef03 | 115 | #define __ALIGNED(x) __attribute__((aligned(x))) |
kevman | 0:38ceb79fef03 | 116 | #endif |
kevman | 0:38ceb79fef03 | 117 | #ifndef __RESTRICT |
kevman | 0:38ceb79fef03 | 118 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. |
kevman | 0:38ceb79fef03 | 119 | #define __RESTRICT |
kevman | 0:38ceb79fef03 | 120 | #endif |
kevman | 0:38ceb79fef03 | 121 | |
kevman | 0:38ceb79fef03 | 122 | |
kevman | 0:38ceb79fef03 | 123 | /* |
kevman | 0:38ceb79fef03 | 124 | * TASKING Compiler |
kevman | 0:38ceb79fef03 | 125 | */ |
kevman | 0:38ceb79fef03 | 126 | #elif defined ( __TASKING__ ) |
kevman | 0:38ceb79fef03 | 127 | /* |
kevman | 0:38ceb79fef03 | 128 | * The CMSIS functions have been implemented as intrinsics in the compiler. |
kevman | 0:38ceb79fef03 | 129 | * Please use "carm -?i" to get an up to date list of all intrinsics, |
kevman | 0:38ceb79fef03 | 130 | * Including the CMSIS ones. |
kevman | 0:38ceb79fef03 | 131 | */ |
kevman | 0:38ceb79fef03 | 132 | |
kevman | 0:38ceb79fef03 | 133 | #ifndef __ASM |
kevman | 0:38ceb79fef03 | 134 | #define __ASM __asm |
kevman | 0:38ceb79fef03 | 135 | #endif |
kevman | 0:38ceb79fef03 | 136 | #ifndef __INLINE |
kevman | 0:38ceb79fef03 | 137 | #define __INLINE inline |
kevman | 0:38ceb79fef03 | 138 | #endif |
kevman | 0:38ceb79fef03 | 139 | #ifndef __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 140 | #define __STATIC_INLINE static inline |
kevman | 0:38ceb79fef03 | 141 | #endif |
kevman | 0:38ceb79fef03 | 142 | #ifndef __STATIC_FORCEINLINE |
kevman | 0:38ceb79fef03 | 143 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 144 | #endif |
kevman | 0:38ceb79fef03 | 145 | #ifndef __NO_RETURN |
kevman | 0:38ceb79fef03 | 146 | #define __NO_RETURN __attribute__((noreturn)) |
kevman | 0:38ceb79fef03 | 147 | #endif |
kevman | 0:38ceb79fef03 | 148 | #ifndef __USED |
kevman | 0:38ceb79fef03 | 149 | #define __USED __attribute__((used)) |
kevman | 0:38ceb79fef03 | 150 | #endif |
kevman | 0:38ceb79fef03 | 151 | #ifndef __WEAK |
kevman | 0:38ceb79fef03 | 152 | #define __WEAK __attribute__((weak)) |
kevman | 0:38ceb79fef03 | 153 | #endif |
kevman | 0:38ceb79fef03 | 154 | #ifndef __PACKED |
kevman | 0:38ceb79fef03 | 155 | #define __PACKED __packed__ |
kevman | 0:38ceb79fef03 | 156 | #endif |
kevman | 0:38ceb79fef03 | 157 | #ifndef __PACKED_STRUCT |
kevman | 0:38ceb79fef03 | 158 | #define __PACKED_STRUCT struct __packed__ |
kevman | 0:38ceb79fef03 | 159 | #endif |
kevman | 0:38ceb79fef03 | 160 | #ifndef __PACKED_UNION |
kevman | 0:38ceb79fef03 | 161 | #define __PACKED_UNION union __packed__ |
kevman | 0:38ceb79fef03 | 162 | #endif |
kevman | 0:38ceb79fef03 | 163 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
kevman | 0:38ceb79fef03 | 164 | struct __packed__ T_UINT32 { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 165 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
kevman | 0:38ceb79fef03 | 166 | #endif |
kevman | 0:38ceb79fef03 | 167 | #ifndef __UNALIGNED_UINT16_WRITE |
kevman | 0:38ceb79fef03 | 168 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 169 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 170 | #endif |
kevman | 0:38ceb79fef03 | 171 | #ifndef __UNALIGNED_UINT16_READ |
kevman | 0:38ceb79fef03 | 172 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 173 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 174 | #endif |
kevman | 0:38ceb79fef03 | 175 | #ifndef __UNALIGNED_UINT32_WRITE |
kevman | 0:38ceb79fef03 | 176 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 177 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 178 | #endif |
kevman | 0:38ceb79fef03 | 179 | #ifndef __UNALIGNED_UINT32_READ |
kevman | 0:38ceb79fef03 | 180 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 181 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 182 | #endif |
kevman | 0:38ceb79fef03 | 183 | #ifndef __ALIGNED |
kevman | 0:38ceb79fef03 | 184 | #define __ALIGNED(x) __align(x) |
kevman | 0:38ceb79fef03 | 185 | #endif |
kevman | 0:38ceb79fef03 | 186 | #ifndef __RESTRICT |
kevman | 0:38ceb79fef03 | 187 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. |
kevman | 0:38ceb79fef03 | 188 | #define __RESTRICT |
kevman | 0:38ceb79fef03 | 189 | #endif |
kevman | 0:38ceb79fef03 | 190 | |
kevman | 0:38ceb79fef03 | 191 | |
kevman | 0:38ceb79fef03 | 192 | /* |
kevman | 0:38ceb79fef03 | 193 | * COSMIC Compiler |
kevman | 0:38ceb79fef03 | 194 | */ |
kevman | 0:38ceb79fef03 | 195 | #elif defined ( __CSMC__ ) |
kevman | 0:38ceb79fef03 | 196 | #include <cmsis_csm.h> |
kevman | 0:38ceb79fef03 | 197 | |
kevman | 0:38ceb79fef03 | 198 | #ifndef __ASM |
kevman | 0:38ceb79fef03 | 199 | #define __ASM _asm |
kevman | 0:38ceb79fef03 | 200 | #endif |
kevman | 0:38ceb79fef03 | 201 | #ifndef __INLINE |
kevman | 0:38ceb79fef03 | 202 | #define __INLINE inline |
kevman | 0:38ceb79fef03 | 203 | #endif |
kevman | 0:38ceb79fef03 | 204 | #ifndef __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 205 | #define __STATIC_INLINE static inline |
kevman | 0:38ceb79fef03 | 206 | #endif |
kevman | 0:38ceb79fef03 | 207 | #ifndef __STATIC_FORCEINLINE |
kevman | 0:38ceb79fef03 | 208 | #define __STATIC_FORCEINLINE __STATIC_INLINE |
kevman | 0:38ceb79fef03 | 209 | #endif |
kevman | 0:38ceb79fef03 | 210 | #ifndef __NO_RETURN |
kevman | 0:38ceb79fef03 | 211 | // NO RETURN is automatically detected hence no warning here |
kevman | 0:38ceb79fef03 | 212 | #define __NO_RETURN |
kevman | 0:38ceb79fef03 | 213 | #endif |
kevman | 0:38ceb79fef03 | 214 | #ifndef __USED |
kevman | 0:38ceb79fef03 | 215 | #warning No compiler specific solution for __USED. __USED is ignored. |
kevman | 0:38ceb79fef03 | 216 | #define __USED |
kevman | 0:38ceb79fef03 | 217 | #endif |
kevman | 0:38ceb79fef03 | 218 | #ifndef __WEAK |
kevman | 0:38ceb79fef03 | 219 | #define __WEAK __weak |
kevman | 0:38ceb79fef03 | 220 | #endif |
kevman | 0:38ceb79fef03 | 221 | #ifndef __PACKED |
kevman | 0:38ceb79fef03 | 222 | #define __PACKED @packed |
kevman | 0:38ceb79fef03 | 223 | #endif |
kevman | 0:38ceb79fef03 | 224 | #ifndef __PACKED_STRUCT |
kevman | 0:38ceb79fef03 | 225 | #define __PACKED_STRUCT @packed struct |
kevman | 0:38ceb79fef03 | 226 | #endif |
kevman | 0:38ceb79fef03 | 227 | #ifndef __PACKED_UNION |
kevman | 0:38ceb79fef03 | 228 | #define __PACKED_UNION @packed union |
kevman | 0:38ceb79fef03 | 229 | #endif |
kevman | 0:38ceb79fef03 | 230 | #ifndef __UNALIGNED_UINT32 /* deprecated */ |
kevman | 0:38ceb79fef03 | 231 | @packed struct T_UINT32 { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 232 | #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) |
kevman | 0:38ceb79fef03 | 233 | #endif |
kevman | 0:38ceb79fef03 | 234 | #ifndef __UNALIGNED_UINT16_WRITE |
kevman | 0:38ceb79fef03 | 235 | __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 236 | #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 237 | #endif |
kevman | 0:38ceb79fef03 | 238 | #ifndef __UNALIGNED_UINT16_READ |
kevman | 0:38ceb79fef03 | 239 | __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; |
kevman | 0:38ceb79fef03 | 240 | #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 241 | #endif |
kevman | 0:38ceb79fef03 | 242 | #ifndef __UNALIGNED_UINT32_WRITE |
kevman | 0:38ceb79fef03 | 243 | __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 244 | #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) |
kevman | 0:38ceb79fef03 | 245 | #endif |
kevman | 0:38ceb79fef03 | 246 | #ifndef __UNALIGNED_UINT32_READ |
kevman | 0:38ceb79fef03 | 247 | __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; |
kevman | 0:38ceb79fef03 | 248 | #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) |
kevman | 0:38ceb79fef03 | 249 | #endif |
kevman | 0:38ceb79fef03 | 250 | #ifndef __ALIGNED |
kevman | 0:38ceb79fef03 | 251 | #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. |
kevman | 0:38ceb79fef03 | 252 | #define __ALIGNED(x) |
kevman | 0:38ceb79fef03 | 253 | #endif |
kevman | 0:38ceb79fef03 | 254 | #ifndef __RESTRICT |
kevman | 0:38ceb79fef03 | 255 | #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. |
kevman | 0:38ceb79fef03 | 256 | #define __RESTRICT |
kevman | 0:38ceb79fef03 | 257 | #endif |
kevman | 0:38ceb79fef03 | 258 | |
kevman | 0:38ceb79fef03 | 259 | |
kevman | 0:38ceb79fef03 | 260 | #else |
kevman | 0:38ceb79fef03 | 261 | #error Unknown compiler. |
kevman | 0:38ceb79fef03 | 262 | #endif |
kevman | 0:38ceb79fef03 | 263 | |
kevman | 0:38ceb79fef03 | 264 | |
kevman | 0:38ceb79fef03 | 265 | #endif /* __CMSIS_COMPILER_H */ |
kevman | 0:38ceb79fef03 | 266 |