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