Rob Kluin / nRF51822

Fork of nRF51822 by Nordic Semiconductor

Committer:
vcoubard
Date:
Mon Jan 11 10:19:10 2016 +0000
Revision:
551:ab7a8de3ff10
Parent:
504:2179e57ad950
Synchronized with git rev 6825c511
Author: Rohit Grover
Release 2.1.0
=============

Upgrading to files from v8.1 of the Nordic SDK.

Who changed what in which revision?

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