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