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:
Thu Nov 23 11:44:04 2017 +0000
Revision:
158:1c57384330a6
Child:
160:5571c4ff569f
mbed library. Release version 156

Who changed what in which revision?

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