Jonathan Austin / nRF51822

Dependents:   microbit_rubber_ducky microbit_mouse_BLE microbit_mouse_BLE_daybreak_version microbit_presenter

Fork of nRF51822 by Nordic Semiconductor

Committer:
JonnyA
Date:
Wed Aug 31 18:59:36 2016 +0000
Revision:
616:b52326e38ebd
Parent:
607:e98331f1d6b5
Workaround for build system bug

Who changed what in which revision?

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