Rob Kluin / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Committer:
rgrover1
Date:
Wed Dec 02 10:32:54 2015 +0000
Revision:
508:43f58b48bbab
Parent:
504:2179e57ad950
Child:
551:ab7a8de3ff10
Synchronized with git rev 7b301508
Author: Rohit Grover
version v2.1.1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
rgrover1 504:2179e57ad950 1 /*
rgrover1 504:2179e57ad950 2 * Copyright (c) Nordic Semiconductor ASA
rgrover1 504:2179e57ad950 3 * All rights reserved.
rgrover1 504:2179e57ad950 4 *
rgrover1 504:2179e57ad950 5 * Redistribution and use in source and binary forms, with or without modification,
rgrover1 504:2179e57ad950 6 * are permitted provided that the following conditions are met:
rgrover1 504:2179e57ad950 7 *
rgrover1 504:2179e57ad950 8 * 1. Redistributions of source code must retain the above copyright notice, this
rgrover1 504:2179e57ad950 9 * list of conditions and the following disclaimer.
rgrover1 504:2179e57ad950 10 *
rgrover1 504:2179e57ad950 11 * 2. Redistributions in binary form must reproduce the above copyright notice, this
rgrover1 504:2179e57ad950 12 * list of conditions and the following disclaimer in the documentation and/or
rgrover1 504:2179e57ad950 13 * other materials provided with the distribution.
rgrover1 504:2179e57ad950 14 *
rgrover1 504:2179e57ad950 15 * 3. Neither the name of Nordic Semiconductor ASA nor the names of other
rgrover1 504:2179e57ad950 16 * contributors to this software may be used to endorse or promote products
rgrover1 504:2179e57ad950 17 * derived from this software without specific prior written permission.
rgrover1 504:2179e57ad950 18 *
rgrover1 504:2179e57ad950 19 *
rgrover1 504:2179e57ad950 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
rgrover1 504:2179e57ad950 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
rgrover1 504:2179e57ad950 22 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
rgrover1 504:2179e57ad950 23 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
rgrover1 504:2179e57ad950 24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
rgrover1 504:2179e57ad950 25 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
rgrover1 504:2179e57ad950 26 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
rgrover1 504:2179e57ad950 27 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
rgrover1 504:2179e57ad950 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
rgrover1 504:2179e57ad950 29 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
rgrover1 504:2179e57ad950 30 *
rgrover1 504:2179e57ad950 31 */
rgrover1 504:2179e57ad950 32 #ifndef _COMPILER_ABSTRACTION_H
rgrover1 504:2179e57ad950 33 #define _COMPILER_ABSTRACTION_H
rgrover1 504:2179e57ad950 34
rgrover1 504:2179e57ad950 35 /*lint ++flb "Enter library region" */
rgrover1 504:2179e57ad950 36
rgrover1 504:2179e57ad950 37 #if defined ( __CC_ARM )
rgrover1 504:2179e57ad950 38
rgrover1 504:2179e57ad950 39 #ifndef __ASM
rgrover1 504:2179e57ad950 40 #define __ASM __asm
rgrover1 504:2179e57ad950 41 #endif
rgrover1 504:2179e57ad950 42
rgrover1 504:2179e57ad950 43 #ifndef __INLINE
rgrover1 504:2179e57ad950 44 #define __INLINE __inline
rgrover1 504:2179e57ad950 45 #endif
rgrover1 504:2179e57ad950 46
rgrover1 504:2179e57ad950 47 #ifndef __WEAK
rgrover1 504:2179e57ad950 48 #define __WEAK __weak
rgrover1 504:2179e57ad950 49 #endif
rgrover1 504:2179e57ad950 50
rgrover1 504:2179e57ad950 51 #ifndef __ALIGN
rgrover1 504:2179e57ad950 52 #define __ALIGN(n) __align(n)
rgrover1 504:2179e57ad950 53 #endif
rgrover1 504:2179e57ad950 54
rgrover1 504:2179e57ad950 55 #define GET_SP() __current_sp()
rgrover1 504:2179e57ad950 56
rgrover1 504:2179e57ad950 57 #elif defined ( __ICCARM__ )
rgrover1 504:2179e57ad950 58
rgrover1 504:2179e57ad950 59 #ifndef __ASM
rgrover1 504:2179e57ad950 60 #define __ASM __asm
rgrover1 504:2179e57ad950 61 #endif
rgrover1 504:2179e57ad950 62
rgrover1 504:2179e57ad950 63 #ifndef __INLINE
rgrover1 504:2179e57ad950 64 #define __INLINE inline
rgrover1 504:2179e57ad950 65 #endif
rgrover1 504:2179e57ad950 66
rgrover1 504:2179e57ad950 67 #ifndef __WEAK
rgrover1 504:2179e57ad950 68 #define __WEAK __weak
rgrover1 504:2179e57ad950 69 #endif
rgrover1 504:2179e57ad950 70
rgrover1 504:2179e57ad950 71 /* Not defined for IAR since it requires a new line to work, and C preprocessor does not allow that. */
rgrover1 504:2179e57ad950 72 #ifndef __ALIGN
rgrover1 504:2179e57ad950 73 #define __ALIGN(n)
rgrover1 504:2179e57ad950 74 #endif
rgrover1 504:2179e57ad950 75
rgrover1 504:2179e57ad950 76 #define GET_SP() __get_SP()
rgrover1 504:2179e57ad950 77
rgrover1 504:2179e57ad950 78 #elif defined ( __GNUC__ )
rgrover1 504:2179e57ad950 79
rgrover1 504:2179e57ad950 80 #ifndef __ASM
rgrover1 504:2179e57ad950 81 #define __ASM __asm
rgrover1 504:2179e57ad950 82 #endif
rgrover1 504:2179e57ad950 83
rgrover1 504:2179e57ad950 84 #ifndef __INLINE
rgrover1 504:2179e57ad950 85 #define __INLINE inline
rgrover1 504:2179e57ad950 86 #endif
rgrover1 504:2179e57ad950 87
rgrover1 504:2179e57ad950 88 #ifndef __WEAK
rgrover1 504:2179e57ad950 89 #define __WEAK __attribute__((weak))
rgrover1 504:2179e57ad950 90 #endif
rgrover1 504:2179e57ad950 91
rgrover1 504:2179e57ad950 92 #ifndef __ALIGN
rgrover1 504:2179e57ad950 93 #define __ALIGN(n) __attribute__((aligned(n)))
rgrover1 504:2179e57ad950 94 #endif
rgrover1 504:2179e57ad950 95
rgrover1 504:2179e57ad950 96 #define GET_SP() gcc_current_sp()
rgrover1 504:2179e57ad950 97
rgrover1 504:2179e57ad950 98 static inline unsigned int gcc_current_sp(void)
rgrover1 504:2179e57ad950 99 {
rgrover1 504:2179e57ad950 100 register unsigned sp __ASM("sp");
rgrover1 504:2179e57ad950 101 return sp;
rgrover1 504:2179e57ad950 102 }
rgrover1 504:2179e57ad950 103
rgrover1 504:2179e57ad950 104 #elif defined ( __TASKING__ )
rgrover1 504:2179e57ad950 105
rgrover1 504:2179e57ad950 106 #ifndef __ASM
rgrover1 504:2179e57ad950 107 #define __ASM __asm
rgrover1 504:2179e57ad950 108 #endif
rgrover1 504:2179e57ad950 109
rgrover1 504:2179e57ad950 110 #ifndef __INLINE
rgrover1 504:2179e57ad950 111 #define __INLINE inline
rgrover1 504:2179e57ad950 112 #endif
rgrover1 504:2179e57ad950 113
rgrover1 504:2179e57ad950 114 #ifndef __WEAK
rgrover1 504:2179e57ad950 115 #define __WEAK __attribute__((weak))
rgrover1 504:2179e57ad950 116 #endif
rgrover1 504:2179e57ad950 117
rgrover1 504:2179e57ad950 118 #ifndef __ALIGN
rgrover1 504:2179e57ad950 119 #define __ALIGN(n) __align(n)
rgrover1 504:2179e57ad950 120 #endif
rgrover1 504:2179e57ad950 121
rgrover1 504:2179e57ad950 122 #define GET_SP() __get_MSP()
rgrover1 504:2179e57ad950 123
rgrover1 504:2179e57ad950 124 #endif
rgrover1 504:2179e57ad950 125
rgrover1 504:2179e57ad950 126 /*lint --flb "Leave library region" */
rgrover1 504:2179e57ad950 127
rgrover1 504:2179e57ad950 128 #endif