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